Reference

Cheat Sheet

The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.

Vim

Survive and thrive in the editor that opens when you least expect it. Esc returns to normal mode.
CommandWhat it doesExample
:wSave (write) the file.:w
:qQuit.:q
:wq or ZZSave and quit.:wq
:q!Quit and throw away changes.:q!
i / aInsert before / after the cursor.i
EscLeave insert mode, back to normal mode.Esc
ddDelete (cut) the current line.dd
yy / pCopy the line / paste it below.yy
u / Ctrl-rUndo / redo.u
/patternSearch forward; press n for the next match./error
:%s/old/new/gFind and replace across the whole file.:%s/foo/bar/g
gg / GJump to the top / bottom of the file.G
0 / $Jump to the start / end of the line.$
:NGo to line number N.:42
v / VStart a character / whole-line selection.V
:set numberShow line numbers.:set number