← All cheatsheets

Editors

Vim survival — when you must edit on a server

Just enough Vim to edit a file on a server: how to exit, switch modes, move around, edit text, save and quit.

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