vim ("Vi IMproved") is the most widely used descendant of the original vi editor written by Bill Joy in 1976. Its defining feature is modal editing: by default you are in normal mode, where keys move the cursor and manipulate text; i enters insert mode for typing; Esc returns to normal mode; : enters command mode for saving, quitting, and running commands.
Essentials:
i insert before cursor
a append after cursor
Esc back to normal mode
:w write (save)
:q quit
:wq write and quit
:q! quit without saving
dd delete (cut) a line
yy yank (copy) a line
p paste below
u undo
Ctrl-R redo
/pattern search forward
Configuration lives in ~/.vimrc. Modern successors include Neovim, which forked vim in 2014 to modernise the codebase and add Lua scripting; on most systems vim and nvim are interchangeable for basic use.
Discussed in:
- Chapter 15: Editors: vi, Vim, and Nano · The Vi/Vim Lineage
Also defined in: Textbook of Linux
