Here is my personal cheat sheet for commands in the Vim editor that I frequently use or tend to forget.
Editing:
i — Enter Insert mode before cursor
a — Enter Insert mode after cursor
o — Open a new line below current line
u — Undo last action
Ctrl + r — Redo
yy — Copy current line
p — Paste after cursor
dd — Delete (cut) current line
Search & Replace:
/pattern — Search forward for pattern
?pattern — Search backward for pattern
n — Next match
N — Previous match
:%s/old/new/g — Replace all occurrences of ‘old’ with ‘new’
Saving & Exiting:
:w — Save file
:q — Quit
:wq — Save and quit
:q! — Quit without saving