☰
Home
/
Cheatsheets
/
Vim / Neovim Cheatsheet
📝
Vim / Neovim Cheatsheet
Vim modes, navigation, editing, macros and splits
☆
Bookmark
Loading tool…
Vim / Neovim Cheatsheet
77 entries · click to copy
⌨️ Modes
i
Insert before cursor
I
Insert at start of line
a
Append after cursor
A
Append at end of line
o
New line below, insert
O
New line above, insert
v
Visual mode (character)
V
Visual line mode
Ctrl+v
Visual block mode
Esc / Ctrl+[
Return to Normal mode
:
Enter Command mode
🧭 Navigation
h j k l
Left / Down / Up / Right
w / b
Next / previous word start
e
End of current word
0 / ^
Start of line / first non-blank
$
End of line
gg / G
First / last line of file
50G
Go to line 50
Ctrl+d / Ctrl+u
Half page down / up
Ctrl+f / Ctrl+b
Full page down / up
{ / }
Previous / next paragraph
%
Jump to matching bracket
'' (two apostrophes)
Jump back to last position
✏️ Editing
x
Delete character under cursor
dd
Delete (cut) current line
D
Delete to end of line
cc
Change entire line
cw
Change word
C
Change to end of line
yy
Yank (copy) line
yw
Yank word
p / P
Paste after / before cursor
u
Undo
Ctrl+r
Redo
.
Repeat last change
>> / <<
Indent / de-indent line
=G
Auto-indent to end of file
J
Join line below to current
🎯 Text Objects
ciw
Change inner word
ci"
Change inside double quotes
ci(
Change inside parentheses
ci{
Change inside braces
dit
Delete inside HTML tag
da(
Delete around parentheses (incl. brackets)
vis
Select inner sentence
vap
Select around paragraph
🔍 Search & Replace
/pattern
Search forward
?pattern
Search backward
n / N
Next / previous match
*
Search for word under cursor
:%s/old/new/g
Replace all in file
:%s/old/new/gc
Replace all with confirmation
:5,10s/old/new/g
Replace in lines 5–10
:noh
Clear search highlight
📂 Files & Buffers
:w
Save file
:wq / ZZ
Save and quit
:q!
Quit without saving
:e file.txt
Open file
:ls
List open buffers
:bn / :bp
Next / previous buffer
:bd
Close buffer
:sp / :vsp
Horizontal / vertical split
Ctrl+w w
Switch between splits
Ctrl+w =
Equalize split sizes
:tab new
New tab
gt / gT
Next / previous tab
⚡ Macros & Advanced
qa
Record macro into register a
q
Stop recording macro
@a
Play macro in register a
10@a
Play macro 10 times
:g/pattern/d
Delete all lines matching pattern
:g/pattern/y A
Yank matching lines to register A
:sort
Sort lines
:sort u
Sort and remove duplicates
Ctrl+a / Ctrl+x
Increment / decrement number
gU / gu
Uppercase / lowercase (motion)
~
Toggle case of char under cursor