Ronalds Vilciņš

A Vim Cheat Sheet for Commands I Keep Forgetting

Vim becomes useful once you stop treating every command as a separate keyboard shortcut. Motions describe where to go, operators describe what to do, and the two can be combined. Until that feels natural, a cheat sheet helps.

Press Esc if you are unsure which mode you are in. It is not elegant advice, but it works surprisingly often.

Move around

Add a count to repeat many commands. 5j moves down five lines, while 3w moves forward three words.

Insert and edit text

Operators combine with motions. dw deletes to the next word, d$ deletes to the end of the line, and y} yanks to the next paragraph boundary. This is the part of Vim worth learning; memorising exotic commands can wait.

Select in visual mode

Search and replace

The final c has prevented enough ambitious replacements that I usually add it first and remove it only when I am certain.

Save, open, and quit

Splits, tabs, and useful settings

Put lasting settings and mappings in .vimrc. Start with a small configuration you understand. Copying a giant setup on the first day is an efficient way to turn someone else’s editor into your own mystery.

Enjoyed reading this?

If you found this article helpful, consider supporting my writing. Every little bit helps keep this blog going.

← Back to all articles