Vim commands cheatsheet.
Modes, motion, editing and search — the Vim commands that get you productive fast. Tap to copy.
iEnter insert mode before the cursoraEnter insert mode after the cursorEscReturn to normal mode:wSave the file:qQuit:wqSave and quit:q!Quit without savingh j k lMove left, down, up, rightwJump to the start of the next wordbJump back to the previous word0Go to the start of the line$Go to the end of the lineggGo to the first lineGGo to the last line:42Jump to line 42xDelete the character under the cursorddDelete the current lineyyCopy (yank) the current linepPaste after the cursoruUndoCtrl + rRedodwDelete to the end of the wordccChange (replace) the whole line/textSearch forward for textnJump to the next search matchNJump to the previous match:%s/old/new/gReplace every occurrence in the file:%s/old/new/gcReplace with confirmation for eachThe idea that unlocks Vim
Vim feels baffling until one idea clicks: it's modal. In normal mode your keys move and manipulate text; press i to drop into insert mode and type normally; press Esc to come back. Beginners get stuck because they start typing in normal mode and chaos ensues — so the very first habit to build is reaching for Esc whenever you're unsure where you are. Everything else in Vim builds on this one distinction.
Motions and operators combine
Vim's real power is a small grammar: operators (like d delete, c change, y yank) combine with motions (w word, $ end of line, gg/G top/bottom). Learn them separately and you automatically get every combination: dw deletes a word, d$ deletes to end of line, cc changes a whole line. This is why Vim users say you don't memorise commands so much as learn a language — a few verbs and nouns produce hundreds of edits.
The survival kit
If you only remember a handful: dd deletes a line, yy copies it, p pastes, u undoes, and Ctrl + r redoes. To get out — the question every newcomer eventually searches for — press Esc, then type :wq to save and quit, or :q! to quit without saving. Don't try to learn everything at once; add one motion a week and let it become reflex. These pair well with the tmux and Linux cheatsheets for a full terminal setup.