Skip to content
Vim Learn

Reference

Every key in the course

The 91 keys these 51 lessons teach, in the order you meet them. Each one links to the lesson that introduces it.

Basic Vim

i
Insert before the cursorIn Introduction to Text Objects: Inner: the contents, without the surrounding delimiters
Introduction to Modes
a
Insert after the cursorIn Introduction to Text Objects: Around: the contents plus the surrounding delimiters
Introduction to Modes
Esc
Return to Normal mode
Introduction to Modes
h
Move one character left
Basic Movement
j
Move one line down
Basic Movement
k
Move one line up
Basic Movement
l
Move one character right
Basic Movement
w
Jump forward to the next word start
Moving by Words
e
Jump forward to the end of a word
Moving by Words
b
Jump back to the previous word start
Moving by Words
I
Insert at the first non-blank character of the line
Insert at Line Ends
A
Append at the end of the line
Insert at Line Ends
o
Open a new line below and start insertingIn Switch Visual Selection Ends: Swap which end of the selection the cursor movesIn Switch Visual Line Ends: Swap which end of the linewise selection moves
Opening New Lines
O
Open a new line above and start inserting
Opening New Lines
x
Delete the character under the cursor
Making Small Edits
s
Substitute the character under the cursor, then keep typing
Making Small Edits
r
Replace one character without leaving Normal mode
Making Small Edits

Essential Motions

W
Jump forward to the next WORD, punctuation and all
Moving by WORDs
E
Jump to the end of the current WORD, punctuation and all
Moving by WORDs
B
Jump back to the previous WORD, punctuation and all
Moving by WORDs
0
Move to column zero, the literal first character
Moving to Line Ends
_
Move to the first non-blank character of the line
Moving to Line Ends
$
Move to the last character of the line
Moving to Line Ends
f
Find the next occurrence of a character on this line
Find Character
F
Find the previous occurrence of a character on this line
Find Character
;
Repeat the last f, F, t, or T on this line
Find Character
t
Stop just before the next occurrence of a character
Till Character
T
Stop just after the previous occurrence of a character
Till Character

Basic Operators

d
Delete operator, waiting for a motion or text objectIn Visual Mode Operators: Delete the selected charactersIn Visual Line Operators: Delete the selected lines
Introduction to Operators
c
Change operator, deleting a range then insertingIn Visual Mode Operators: Change the selected charactersIn Visual Line Operators: Change the selected lines
Introduction to Operators
y
Yank (copy) operator, waiting for a motion or text objectIn Visual Mode Operators: Yank the selected charactersIn Visual Line Operators: Yank the selected lines
Introduction to Operators
dw
Delete from the cursor to the next word start
Delete Words
dW
Delete to the next WORD, punctuation included
Delete Words
de
Delete to the end of the current word
Delete Words
cw
Change from the cursor to the end of the word
Change Words
ce
Change to the end of the current word
Change Words
dd
Delete the whole line
Delete Lines
D
Delete from the cursor to the end of the line
Delete Lines
d{n}j
Delete this line and the n lines below it
Delete Multiple Lines
d{n}k
Delete this line and the n lines above it
Delete Multiple Lines
yy
Yank the whole line
Copy and Paste Lines
p
Paste after the cursor, or below for a whole lineIn Visual Line Operators: Replace the selected lines with what was yanked
Copy and Paste Lines
P
Paste before the cursor, or above for a whole line
Copy and Paste Lines

Vertical Navigation

{n}j
Move down n lines in one jump
Relative Line Jumps
{n}k
Move up n lines in one jump
Relative Line Jumps
gg
Jump to the first line of the file
Absolute Line Jumps
G
Jump to the last line of the file
Absolute Line Jumps
{n}gg
Jump straight to line n
Absolute Line Jumps
{
Jump back to the previous blank line
Paragraph Jumps
}
Jump forward to the next blank line
Paragraph Jumps
Ctrl-d
Scroll down half a screen
Window Scrolls
Ctrl-u
Scroll up half a screen
Window Scrolls

Search

/
Search forward for a pattern you type
Search
?
Search backward for a pattern you type
Search
Enter
Accept the search and jump to the match
Search
n
Repeat the last search in the same direction
Repeat Search
N
Repeat the last search in the opposite direction
Repeat Search
*
Search forward for the word under the cursor
Quick Word Search
#
Search backward for the word under the cursor
Quick Word Search

Text Objects · Brackets

di(
Delete inside the parentheses, keeping the pair
Delete Inside Brackets
di[
Delete inside the square brackets, keeping the pair
Delete Inside Brackets
di{
Delete inside the braces, keeping the pair
Delete Inside Brackets
da(
Delete the parentheses and everything inside them
Delete Around Brackets
da[
Delete the square brackets and everything inside them
Delete Around Brackets
da{
Delete the braces and everything inside them
Delete Around Brackets
ci(
Change inside the parentheses, keeping the pair
Change Inside Brackets
ci[
Change inside the square brackets, keeping the pair
Change Inside Brackets
ci{
Change inside the braces, keeping the pair
Change Inside Brackets
ca(
Change the parentheses and everything inside them
Change Around Brackets
ca[
Change the square brackets and everything inside them
Change Around Brackets
ca{
Change the braces and everything inside them
Change Around Brackets

Text Objects · Quotes

di"
Delete inside the double quotes, keeping the marks
Delete Inside Quotes
di'
Delete inside the single quotes, keeping the marks
Delete Inside Quotes
di`
Delete inside the backticks, keeping the marks
Delete Inside Quotes
da"
Delete the double-quoted string, quote marks included
Delete Around Quotes
da'
Delete the single-quoted string, quote marks included
Delete Around Quotes
da`
Delete the backtick string, the backticks included
Delete Around Quotes
ci"
Change inside the double quotes, keeping the marks
Change Inside Quotes
ci'
Change inside the single quotes, keeping the marks
Change Inside Quotes
ci`
Change inside the backticks, keeping the marks
Change Inside Quotes
ca"
Change the double-quoted string, quote marks included
Change Around Quotes
ca'
Change the single-quoted string, quote marks included
Change Around Quotes
ca`
Change the backtick string, the backticks included
Change Around Quotes

Text Objects · Words

diw
Delete the word under the cursor, leaving the spaces
Delete Inside Word
daw
Delete the word under the cursor and its trailing space
Delete Around Word
ciw
Change the word under the cursor from anywhere inside it
Change Inside Word

Text Objects · Paragraphs

dip
Delete the paragraph, keeping the blank lines around it
Delete Inside Paragraph
dap
Delete the paragraph and its trailing blank line
Delete Around Paragraph
cip
Change the paragraph, keeping the blank lines around it
Change Inside Paragraph

Visual Mode

v
Enter Visual mode to select characters
Introduction to Visual Mode
V
Enter Visual Line mode to select whole lines
Visual Line Mode