Vim Cheatsheet
The Vim commands worth memorising first. Vim is modal — most keys do something only in the right mode, which is the key thing to internalise.
Modes
Insert before / after the cursor.
Return to normal mode.
Visual mode (character / line).
Command-line mode.
Movement
Left, down, up, right.
Forward / back one word.
Start / end of line.
Top / bottom of file.
Jump to line 42.
Editing
Delete character / whole line.
Copy (yank) line / paste after.
Undo / redo.
Change to end of word.
Repeat the last change.
Search & replace
Search forward; n / N for next / previous.
Replace all occurrences in the file.
Replace all, asking for confirmation.
Search for the word under the cursor.
Files
Save.
Quit (fails if unsaved changes).
Save and quit.
Quit without saving.