Cheatsheet: Vim
Last updated 2026-09-27
Modes
Enter insert mode before/after cursor
Insert at start/end of line
Open a new line below/above and enter insert mode
Return to normal mode
Visual mode: character-wise / line-wise / block-wise
Replace mode (typing overwrites existing characters)
Motions & Navigation
Left, down, up, right
Word forward / word backward / end of word
Start / end of line
First non-blank character of line
Go to line N (or last line with no count)
Top / middle / bottom of screen
Jump to matching bracket/paren
Search forward / backward, repeat, repeat reversed
Find character forward/backward on the current line, till before it
Editing
Delete character / delete line
Yank (copy) line / paste after / paste before
Change (delete + insert) to end of word
Undo / redo
Repeat last change
Join current line with the next
Indent / unindent selected lines
Delete inner word / a parenthesized expression / inner quotes
Prefix any operator/motion with a count
Search & Replace
Replace all occurrences on the current line
Replace all occurrences in the whole file
Replace with confirmation for each match
Case-insensitive replace
Replace within a visual selection (auto-fills the range)
Match whole word only
Buffers, Windows & Tabs
List open buffers
Switch to buffer by number/name
Split window horizontally / vertically
Move focus between windows
Open a new tab / go to next tab
Save file / save and quit / quit discarding changes
Save only if modified, then quit
Common :set Options
Show line numbers
Highlight search matches
Case-insensitive search (unless a capital letter is typed)
Use spaces instead of tabs, with a given width
Persist a setting across sessions