Navigating
Vim Text Editor Quick Reference
1 min read
Published Jul 6 2025
Guide Sections
Guide Comments
Moving the cursor
Key | Description |
---|---|
h | Move left |
Alternative move left | |
l | Move right |
Alternative move right | |
j | Move down |
Alternative move down | |
k | Move up |
Alternative move u |
Other movements
Key | Description |
---|---|
Ctrl+u | Half page up |
Ctrl+d | Half page down |
Ctrl+b | Full page up |
Ctrl+f | Full page down |
b | Previous word |
w | Next word |
ge | End of previous word |
e | End of next word |
$ | End of the line |
0 | Start of the line |
^ | Start of the line, at the end of the starting white space |
fletter | Moves the cursor forwards to the next instance of the letter pressed. eg. f b will move the cursor to the next letter b on the same line |
Fletter | Moves the cursor backwards to the prvious instance of the letter pressed on the same line |
tletter | Moves the cursor before the next instance of the letter pressed on the same line |
Tletter | Moves the cursor before the previous instance of the letter pressed on the same line |
l | Move the cursor forwards 1 on the same line |
numberl | Move the cursor forward whatever number pressed on the same line |
gg | Move the cursor to the first line of the document |
G | Move the cursor to the last line of the document |
:numberenter | Move to the numbers line |
numberG | Move to the numbers line alternative |
H | Move the cursor to the top of the screen |
M | Move the cursor to the middle of the screen |
L | Move the cursor to the bottom of the screen |
zt | Scroll the current line to the top of the screen |
zz | Scroll the current line to the middle of the screen |
zb | Scroll the current line to the bottom of the screen |
Brackets
Key | Description |
---|---|
% | When the cursor is on a [ { ( ) } ] then pressing % will jump the cursor to the opposite of the pair |
Folds
Folding hides part of the buffer so you can focus on specific sections.
Key | Description |
---|---|
za | Toggle fold open or closed |
zo | Open fold |
zc | Close fold |
zr | Reduce folding level (open more folds) |
zm | Increase folding level (close more folds) |
zR | Open all folds |
zM | Close all folds |
zd | Delete the fold under the cursor |
zE | Delete all folds |
Marks
You can set marks in a file for the cursor position and jump between them. Marks can be saved as any letter a-z.
Key | Description |
---|---|
mletter | Set a mark and save as the letter |
'letter | Jump to the line that the mark letter is on |
`a | Jump to the exact position that mark letter is at |