Basics & Movement
Basic Movement
h/j/k/l
Move left/down/up/right
w/b
Move forward/backward by word
e/ge
Move to end of word forward/backward
W/B/E
Move by WORD (whitespace-separated)
Line Navigation
0
Jump to beginning of line
$
Jump to end of line
^
Jump to first non-blank character
g_
Jump to last non-blank character
File Navigation
gg
Go to first line
G
Go to last line
:{number}
Go to line number
Ctrl+d/u
Scroll down/up half page
Character Navigation
f{char}
Jump to next occurrence of character
F{char}
Jump to previous occurrence of character
t{char}
Jump to before next occurrence
T{char}
Jump to after previous occurrence
;
Repeat last f/F/t/T command
,
Repeat last f/F/t/T in opposite direction
💡 Movement Tip
Use numbers with movement commands!
3w
moves 3 words forward,
5j
moves 5 lines down.
Essential Editing
Insert Mode
i
Insert before cursor
a
Insert after cursor
I
Insert at beginning of line
A
Insert at end of line
o
Open new line below
O
Open new line above
Delete Operations
x
Delete character under cursor
X
Delete character before cursor
dd
Delete entire line
dw
Delete word
d$
Delete to end of line
d0
Delete to beginning of line
Copy & Paste
yy
Copy (yank) entire line
yw
Copy word
y$
Copy to end of line
p
Paste after cursor
P
Paste before cursor
Undo & Redo
u
Undo
Ctrl+r
Redo
U
Undo all changes on current line
Example Workflow:
dd → delete current line
3dd → delete 3 lines
yy → copy line
p → paste below
u → undo if needed
Text Objects
Word Objects
iw
Inner word (without surrounding whitespace)
aw
A word (with surrounding whitespace)
iW
Inner WORD (non-whitespace sequence)
aW
A WORD (with surrounding whitespace)
Bracket Objects
i( / i) / ib
Inside parentheses
a( / a) / ab
Around parentheses (including brackets)
i[ / i]
Inside square brackets
a[ / a]
Around square brackets
i{ / i} / iB
Inside curly braces
a{ / a} / aB
Around curly braces
i< / i>
Inside angle brackets
a< / a>
Around angle brackets
Quote Objects
i"
Inside double quotes
a"
Around double quotes (including quotes)
i'
Inside single quotes
a'
Around single quotes
i`
Inside backticks
a`
Around backticks
Sentence & Paragraph Objects
is
Inner sentence
as
A sentence (with trailing whitespace)
ip
Inner paragraph
ap
A paragraph (with surrounding blank lines)
Tag Objects (HTML/XML)
it
Inside tag
at
Around tag (including the tags)
💡 Text Objects Tip
Text objects are used with operators! Try
ciw
(change inner word),
di"
(delete inside
quotes), or
ya{
(yank around braces).
Operators
Basic Operators
d
Delete
c
Change (delete and enter insert mode)
y
Yank (copy)
v
Visual select
Case Operators
g~
Toggle case
gu
Make lowercase
gU
Make uppercase
Formatting Operators
=
Auto-indent
>
Indent right
<< /span>
Indent left
!
Filter through external command
Operator + Text Object Examples:
ciw → change inner word
di" → delete inside quotes
ya{ → yank around braces
=ip → auto-indent paragraph
gUiw → make word uppercase
>i{ → indent inside braces
Search & Replace
Basic Search
/pattern
Search forward
?pattern
Search backward
n
Next search result
N
Previous search result
*
Search for word under cursor (forward)
#
Search for word under cursor (backward)
Replace Commands
:s/old/new/
Replace first occurrence in line
:s/old/new/g
Replace all in current line
:%s/old/new/g
Replace all occurrences in file
:%s/old/new/gc
Replace all with confirmation
:5,12s/old/new/g
Replace in lines 5-12
Search Options
:set ignorecase
Case-insensitive search
:set noignorecase
Case-sensitive search
:set hlsearch
Highlight search results
:nohlsearch
Clear search highlighting
Common Search Patterns:
/\<word\> → search for exact word
/^pattern → search at beginning of line
/pattern$ → search at end of line
/[abc] → search for any of a, b, or c
/\d → search for any digit
Power Combinations
Change Operations
ciw
Change inner word
ci"
Change inside quotes
ci(
Change inside parentheses
cit
Change inside HTML tag
cis
Change inner sentence
cap
Change around paragraph
Delete Operations
diw
Delete inner word
di"
Delete inside quotes
da{
Delete around curly braces
dit
Delete inside HTML tag
dap
Delete around paragraph
Yank Operations
yiw
Yank inner word
yi"
Yank inside quotes
ya{
Yank around curly braces
yit
Yank inside HTML tag
yap
Yank around paragraph
Advanced Combinations with Numbers
d3w
Delete 3 words
c2j
Change current line plus 2 below
y4l
Yank 4 characters to the right
3dd
Delete 3 lines
5yy
Yank 5 lines
=3}
Auto-indent 3 paragraphs
Pro Workflow Examples:
1. Change function name: f( → bi → ciw → type new name
2. Duplicate line: yy → p
3. Delete function: di{ → delete inside braces
4. Change HTML content: cit → change inside tag
5. Fix indentation: =ap → auto-indent paragraph
🚀 Master's Tip
The real power is combining operators + text objects + counts. Practice
d2aw
(delete 2 words),
c3is
(change 3 sentences),
y4ap
(yank 4 paragraphs). Once this becomes muscle memory,
you'll edit at the speed of thought!