Vim Cheatsheet for Beginners


Perfect ๐ A one-page Vim cheatsheet will help you build muscle memory fast. Hereโs a clean, compact version you can keep open while practicing:
๐ข Vim Cheatsheet
๐น Modes
Normal mode โ (default) for commands & navigation
Insert mode โ type text (
i
,a
,o
)Visual mode โ select text (
v
,V
)Command mode โ type
:
for commands
๐น File & Exit
Action | Command |
Save | :w |
Quit | :q |
Save & quit | :wq |
Quit without saving | :q! |
Save asโฆ | :w filename |
๐น Insert Text
Action | Command |
Insert before cursor | i |
Insert after cursor | a |
New line below | o |
New line above | O |
Append at end of line | A |
๐น Navigation
Action | Command |
Left / Down / Up / Right | h j k l |
Start of line | 0 |
End of line | $ |
Next word | w |
Previous word | b |
End of word | e |
Go to line N | :N |
First line | gg |
Last line | G |
Half page down / up | Ctrl-d / Ctrl-u |
๐น Editing
Action | Command |
Delete character | x |
Delete word | dw |
Delete to end of line | D |
Delete line | dd |
Copy (yank) line | yy |
Paste | p |
Change word (delete + insert) | cw |
Replace single character | r<char> |
Undo | u |
Redo | Ctrl-r |
๐น Visual Mode
Action | Command |
Start selection | v (char), V (line) |
Copy | y |
Delete | d |
Indent | > |
Unindent | < |
๐น Search & Replace
Action | Command |
Search forward | /word then n (next), N (prev) |
Search backward | ?word |
Replace (line) | :s/old/new/g |
Replace (file) | :%s/old/new/g |
โก Memory tricks:
:w
= write,:q
= quit,!
= forced
= delete,y
= yank (copy),p
= pasteMotions:
w
(word),$
(end),0
(start),e
(end of word)
โ Thatโs all you need to survive and thrive in Vim.
Subscribe to my newsletter
Read articles from UR Prakash Gupta directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

UR Prakash Gupta
UR Prakash Gupta
My name is ๐๐ ๐๐ซ๐๐ค๐๐ฌ๐ก ๐๐ฎ๐ฉ๐ญ๐ and I talk about ๐ง๐ฒ๐ฐ๐ต-๐๐ง๐จ๐ฐ๐ฅ๐๐๐ ๐, ๐ช๐ฒ๐ฏ๐๐ฒ๐, ๐๐ฒ๐๐ข๐ฝ๐ and ๐๐ถ๐ณ๐ฒ๐๐๐๐น๐ฒ.