← All cheatsheets

Editors

Vim survival — when you must edit on a server

## Exit (the most-Googled command)
`Esc` then `:q` — quit
`Esc` then `:wq` — write + quit
`Esc` then `:q!` — quit without saving

## Modes
`Esc` — normal mode (default)
`i` — insert mode
`v` — visual mode (select)

## Move (in normal mode)
`h j k l` — left down up right
`w` / `b` — word forward / backward
`0` / `$` — line start / end
`gg` / `G` — file start / end
`Ctrl-d` / `Ctrl-u` — half page down/up

## Edit
`dd` — delete line
`yy` — yank (copy) line
`p` — paste below
`u` / `Ctrl-r` — undo / redo
`/text` then `Enter` — search
`n` — next match