Tutorial by Examples

The Vim on your machine—if there is one—is very likely to be a "small" build that lacks useful features like clipboard support, syntax highlighting or even the ability to use plugins. This is not a problem if all you need is a quick way to edit config files but you will soon hit a number ...
In order to exit Vim, first make sure you are in Normal mode by pressing Esc. :q Enter (will prevent you from exiting if you have unsaved changes - short for :quit) To discard changes and exit Vim: :q! Enter to force exit and discard changes (short for :quit!, not to be confused with :!q), ...
vimtutor is an interactive tutorial covering the most basic aspects of text editing. On UNIX-like system, you can start the tutorial with: $ vimtutor On Windows, “Vim tutor” can be found in the “Vim 7.x” directory under “All Programs” in the Windows menu. See :help vimtutor for further details...
Sometimes, we may open a file which we do not have permission to write in Vim without using sudo. Use this command to save a read-only file edited in Vim. :w !sudo tee > /dev/null % Which you could map to :w!! in your .vimrc: cmap w!! w !sudo tee > /dev/null % You will be presented a ...
When using vim from the command line, you can suspend vim and get back to your prompt, without actually quitting vim. Hence you will later be able to get back your vim session from the same prompt. When in Normal mode (if not, press esc to get there), issue either of these commands: :stenter :s...
Run interactive vim tutorials as many times as needed to feel comfortable with the basics. Vim features several modes, e.g. normal mode, insert mode and command-line mode. Normal mode is for editing and navigating text. In this mode h, j, k and l correspond to the cursor keys ←, ↓, ↑ and →. Most c...
Vim saves all your unsaved edits in a swap file, an extra file that gets deleted once the changes are committed by saving. The name of the swap file is usually the name of the file being edited preceded by a . and with a .swp suffix (you can see it with :sw). So in case your vim process terminates ...

Page 1 of 1