Basic VIM Cheat Sheet

Basic VIM commands to get you started

Adding Text

ActionCommand
Insert at current positioni
Insert one 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 show, begin with Esc + :

ActionCommand
Savew + Enter
Save and quitwq + Enter
Save and quit x + Enter
Quit ignoring changesq!
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.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s