Basic VIM Cheat Sheet

Basic VIM commands to get you started

Adding Text

ActionCommand
Insert at current positioni
Insert on character to the righta
Enter Normal mode by pressing Esc.

(You can get a bit more detail regarding the difference between these two here.)

Saving

For every command shown, begin with Esc + :

ActionCommand
Savew + Enter
Save and quitwq + Enter
Save and quitx + Enter
Quit (ignore changes)q! + Enter
Enter Normal mode by pressing Esc.

Navigating

ActionCommand
Beginning of Documentgg
End of DocumentShift+G
Go to Line 3131 Shift+G
Beginning of Line0
End of Line$
Ahead one wordw
Ahead 5 words5 w
Back one wordb
Back 5 words5 b
Enter Normal mode by pressing Esc.

Editing

ActionCommand
Delete the current linedd
Delete n lines
To delete 3 lines total (the line you’re on, plus two below), type d, then “dd”.
n dd
Enter Normal mode by pressing Esc.
Pair of compasses for navigation on a sea map.
You May Also Like