Post

Vim Cheat Sheet (One Page)

Vim Cheat Sheet (One Page)

Vim Cheat Sheet

Here is another cheatsheet for vim which is a bit longer than one page but has no advertisements and downloads in text or PDF format. *Download PDF Cheat sheet | *Download Text Cheat sheet


🧭 Modes

ModeKey to EnterDescription
NormalEscNavigation & commands
Inserti, a, etc.Text input
Visualv, V, Ctrl+vSelect text
Command:Execute commands

✍️ Basic Editing

ActionCommand
Insert before cursori
Append after cursora
Insert new line belowo
Insert new line aboveO
Delete characterx
Delete worddw
Delete linedd
Undou
RedoCtrl+r

🔁 Replacing & Changing

TaskCommand
Replace characterr<char>
Change wordcw
Change to end of lineC or c$
Replace in file:%s/old/new/g
Confirm replace:%s/old/new/gc

🔠 Case Changing

TaskCommand
Uppercase wordgUw
Uppercase selectiongU (in visual mode)
Lowercase wordguw
Toggle case (char)~

📍 Navigation

Move ToCommand
Beginning of line0
First non-whitespace^
End of line$
Word forwardw
Word backwardb
Paragraph forward/back{ / }
File top/bottomgg / G

TaskCommand
Search forward/pattern
Search backward?pattern
Next/prev matchn / N
Clear highlight:noh

📦 Buffers & Files

ActionCommand
Save:w
Quit:q
Save & quit:wq or ZZ
Quit without saving:q!
Open file:e filename
Switch buffer:bnext / :bprev

🧠 Pro tip: Use . to repeat your last change. ```

This post is licensed under CC BY 4.0 by the author.