SlideShare a Scribd company logo
1 of 12
Download to read offline
You press the keys with no effect,
Your mode is not correct.
The screen blurs, your fingers shake;
You forgot to press escape.
Can't insert, can't delete,
Cursor keys won't repeat.
You try to quit, but can't leave,
An extra "bang" is all you need.

♫

Addicted To vi (http://www.gnu.org/fun/jokes/vi.song.html)
Tim Gremalm
Developer at Conmel Data AB
Programming, Web, Databases, Windows/Linux, Servers,
Network, TCP/IP, Robotics, Electronics

tim@gremalm.se
http://tim.gremalm.se

Texteditor Demo - VI/VIM (Tim Gremalm)
vi - an old editor (37 years)
●

First written by Bill Joy (1976) at Berkeley University

●

Is defined in POSIX (Portable Operating System Interface)
and i Single Unix Specification

●

A visual mode for the editor ex

●

Terminal-based

Texteditor Demo - VI/VIM (Tim Gremalm)
vim - Vi IMproved
●

Written by Bram Moolenaar (1991) at Atari - Amiga

●

A extended version of vi, with more features

●

Still terminal-based

●

gVim (GUI)

Texteditor Demo - VI/VIM (Tim Gremalm)
Texteditor Demo - VI/VIM (Tim Gremalm)
Why you should know Vim
●

A whole world of UNIX-culture

●

more/less

●

Regular expressions

●

Cross platform - it even exists in Computercraft (Minecraft)

●

Quick and Responsive - To start, and to work with

●

Efficient

Texteditor Demo - VI/VIM (Tim Gremalm)
How to work with Vim
●

You start out in normal mode, all keys is mapped to different commands

●

Navigation h/j/k/l or ←/↓/↑/→

●

Jump between Characters, Words, Sentence, Paragraphs and Lines

●

Go to line X

●

To start edit, you will have to switch mode

Texteditor Demo - VI/VIM (Tim Gremalm)
How to work with Vim
modes and escape

Texteditor Demo - VI/VIM (Tim Gremalm)
How to work with Vim
●

You build sentences of how you want to edit
<number><command><text object or motion>

●
●
●

y - “yank” copy
d - delete
p - “put” paste

●
●
●
●
●

y3j - yank 3 down
d3w - delete 3 words
yap - yank a paragraph
cw - change word, followed by insert
cia - change inner argument

●

. - Repat last change

●

Edit beyond individual characters. Instead, edit by word, sentence, line,
and paragraph

Texteditor Demo - VI/VIM (Tim Gremalm)
Commands in Vim
●

:%s/foo/bar/g - Substitute “foo” for “bar” globally

●

:set paste - Enable paste-mode

●
●

:w newfilename - Save as new filename
:r filetoimport - Imports file after cursor

●
●
●

:set enc=utf-8 - Character-encoding
:set ff=dos - Newline mode
:setf c - Syntax language

●
●
●
●

:set tabstop=4 - Length of a tab
:set shiftwidth=4 - Indentation tab width
:set expandtab - Convert tabs into spaces
:retab - Convert all tabs to set indentation-parameters

●

@: - Repeat last command

Texteditor Demo - VI/VIM (Tim Gremalm)
Vim features
●

Tabs

●

Split pane

●

Python-support

●

Plugins (.vim)

Texteditor Demo - VI/VIM (Tim Gremalm)
Plugins for Vim
●

Vundle

●

Powerline

●

Autocomplete

●

Ctrl+P

●

NERDTree

Texteditor Demo - VI/VIM (Tim Gremalm)
Links
●

http://vim-adventures.com/ - A small Vim-game (get started)

●

http://www.vim.org/ - Vim’s mainsite

●

http://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide/ - Edit efficently

●

http://vimbits.com/ - Vim tips

●

https://news.ycombinator.com/ - News about programming, alot of vim-stuff appears here

Texteditor Demo - VI/VIM (Tim Gremalm)

More Related Content

Similar to Kodar-lan - Text and editors Vi/Vim

Similar to Kodar-lan - Text and editors Vi/Vim (20)

Kick my mouse away
Kick my mouse awayKick my mouse away
Kick my mouse away
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vim
 
Useful Vim Plugins
Useful Vim PluginsUseful Vim Plugins
Useful Vim Plugins
 
Vim Vi Improved
Vim Vi ImprovedVim Vi Improved
Vim Vi Improved
 
Vim
VimVim
Vim
 
Tmux quick intro
Tmux quick introTmux quick intro
Tmux quick intro
 
Basics
BasicsBasics
Basics
 
Editing Tricks in Vim editor: The Power of dyp
Editing Tricks in Vim editor: The Power of dypEditing Tricks in Vim editor: The Power of dyp
Editing Tricks in Vim editor: The Power of dyp
 
Intro to the command line
Intro to the command lineIntro to the command line
Intro to the command line
 
How to use git from vim @vim conf2013
How to use git from vim @vim conf2013How to use git from vim @vim conf2013
How to use git from vim @vim conf2013
 
How to write patches for Vim
How to write patches for VimHow to write patches for Vim
How to write patches for Vim
 
What is Vim?
What is Vim?What is Vim?
What is Vim?
 
Vi editor
Vi editorVi editor
Vi editor
 
Small Screen Development
Small Screen DevelopmentSmall Screen Development
Small Screen Development
 
Introduction to Vim 8.0
Introduction to Vim 8.0Introduction to Vim 8.0
Introduction to Vim 8.0
 
Introduction to Vim
Introduction to VimIntroduction to Vim
Introduction to Vim
 
Vim week
Vim weekVim week
Vim week
 
Vim Book
Vim BookVim Book
Vim Book
 
Feel++ webinar 9 27 2012
Feel++ webinar 9 27 2012Feel++ webinar 9 27 2012
Feel++ webinar 9 27 2012
 

Recently uploaded

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Recently uploaded (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Kodar-lan - Text and editors Vi/Vim

  • 1. You press the keys with no effect, Your mode is not correct. The screen blurs, your fingers shake; You forgot to press escape. Can't insert, can't delete, Cursor keys won't repeat. You try to quit, but can't leave, An extra "bang" is all you need. ♫ Addicted To vi (http://www.gnu.org/fun/jokes/vi.song.html) Tim Gremalm Developer at Conmel Data AB Programming, Web, Databases, Windows/Linux, Servers, Network, TCP/IP, Robotics, Electronics tim@gremalm.se http://tim.gremalm.se Texteditor Demo - VI/VIM (Tim Gremalm)
  • 2. vi - an old editor (37 years) ● First written by Bill Joy (1976) at Berkeley University ● Is defined in POSIX (Portable Operating System Interface) and i Single Unix Specification ● A visual mode for the editor ex ● Terminal-based Texteditor Demo - VI/VIM (Tim Gremalm)
  • 3. vim - Vi IMproved ● Written by Bram Moolenaar (1991) at Atari - Amiga ● A extended version of vi, with more features ● Still terminal-based ● gVim (GUI) Texteditor Demo - VI/VIM (Tim Gremalm)
  • 4. Texteditor Demo - VI/VIM (Tim Gremalm)
  • 5. Why you should know Vim ● A whole world of UNIX-culture ● more/less ● Regular expressions ● Cross platform - it even exists in Computercraft (Minecraft) ● Quick and Responsive - To start, and to work with ● Efficient Texteditor Demo - VI/VIM (Tim Gremalm)
  • 6. How to work with Vim ● You start out in normal mode, all keys is mapped to different commands ● Navigation h/j/k/l or ←/↓/↑/→ ● Jump between Characters, Words, Sentence, Paragraphs and Lines ● Go to line X ● To start edit, you will have to switch mode Texteditor Demo - VI/VIM (Tim Gremalm)
  • 7. How to work with Vim modes and escape Texteditor Demo - VI/VIM (Tim Gremalm)
  • 8. How to work with Vim ● You build sentences of how you want to edit <number><command><text object or motion> ● ● ● y - “yank” copy d - delete p - “put” paste ● ● ● ● ● y3j - yank 3 down d3w - delete 3 words yap - yank a paragraph cw - change word, followed by insert cia - change inner argument ● . - Repat last change ● Edit beyond individual characters. Instead, edit by word, sentence, line, and paragraph Texteditor Demo - VI/VIM (Tim Gremalm)
  • 9. Commands in Vim ● :%s/foo/bar/g - Substitute “foo” for “bar” globally ● :set paste - Enable paste-mode ● ● :w newfilename - Save as new filename :r filetoimport - Imports file after cursor ● ● ● :set enc=utf-8 - Character-encoding :set ff=dos - Newline mode :setf c - Syntax language ● ● ● ● :set tabstop=4 - Length of a tab :set shiftwidth=4 - Indentation tab width :set expandtab - Convert tabs into spaces :retab - Convert all tabs to set indentation-parameters ● @: - Repeat last command Texteditor Demo - VI/VIM (Tim Gremalm)
  • 10. Vim features ● Tabs ● Split pane ● Python-support ● Plugins (.vim) Texteditor Demo - VI/VIM (Tim Gremalm)
  • 12. Links ● http://vim-adventures.com/ - A small Vim-game (get started) ● http://www.vim.org/ - Vim’s mainsite ● http://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide/ - Edit efficently ● http://vimbits.com/ - Vim tips ● https://news.ycombinator.com/ - News about programming, alot of vim-stuff appears here Texteditor Demo - VI/VIM (Tim Gremalm)