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
Mode | Key to Enter | Description |
---|---|---|
Normal | Esc | Navigation & commands |
Insert | i , a , etc. | Text input |
Visual | v , V , Ctrl+v | Select text |
Command | : | Execute commands |
✍️ Basic Editing
Action | Command |
---|---|
Insert before cursor | i |
Append after cursor | a |
Insert new line below | o |
Insert new line above | O |
Delete character | x |
Delete word | dw |
Delete line | dd |
Undo | u |
Redo | Ctrl+r |
🔁 Replacing & Changing
Task | Command |
---|---|
Replace character | r<char> |
Change word | cw |
Change to end of line | C or c$ |
Replace in file | :%s/old/new/g |
Confirm replace | :%s/old/new/gc |
🔠 Case Changing
Task | Command |
---|---|
Uppercase word | gUw |
Uppercase selection | gU (in visual mode) |
Lowercase word | guw |
Toggle case (char) | ~ |
📍 Navigation
Move To | Command |
---|---|
Beginning of line | 0 |
First non-whitespace | ^ |
End of line | $ |
Word forward | w |
Word backward | b |
Paragraph forward/back | { / } |
File top/bottom | gg / G |
🔍 Search
Task | Command |
---|---|
Search forward | /pattern |
Search backward | ?pattern |
Next/prev match | n / N |
Clear highlight | :noh |
📦 Buffers & Files
Action | Command |
---|---|
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.