Operators
Vim Text Editor Quick Reference
2 min read
Published Jul 6 2025
Guide Sections
Guide Comments
Vim has a number of operators that can be combined with motions to do different actions.
To use them you press:
- Operator - selects what action is to happen.
- Motion - tell how far or what to act on.
You can also enter operator
operator
to apply the operator to the whole line without using a motion. eg. d
d
will delete a whole line or y
y
will yank a whole line.
List of operators available
Key | Description |
---|---|
d | Delete |
y | Yank (copy) |
c | Change and put in to insert mode |
> | Indent right |
< | Indent left |
g~ | Toggle case |
gu | Make lowercase |
gU | Make upper case |
! | Filter through external command |
= | Auto-indent, auto format code |
p | Paste |
Character & word motions
Key | Description |
---|---|
h | Left character |
l | Right character |
w | Start of next word |
W | Start of next word in white space |
b | Start of previous word |
B | Start of previous word in white space |
e | End of current word |
E | End of current word in white space |
Line & paragraph motions
Key | Description |
---|---|
0 | Start of the line |
^ | First non-whitespace on the line |
$ | End of the line |
gg | Top of the file |
G | Bottom of the file |
{ | Previous paragraph |
} | Next paragrap |
Search & match motions
Key | Description |
---|---|
/pattern | Search forward |
?pattern | Search backwards |
n | Next search match |
N | Previous search match |
% | Jump to matching [ { ( ) } ] bracket |
Find & to motions
Key | Description |
---|---|
fcharacter | Find next occurrence of character |
Fcharacter | Find previous occurrence of character |
tcharacter | Move to the next occurrence of the character |
Tcharacter | Move to the previous occurrence of the character |
Line-wise motions
Key | Description |
---|---|
j | Move down one line |
k | Move up one line |
} | Paragraph forwards |
{ | Paragraph backwards |
}} | Blank line block forwards |
{{ | Blank line block backwards |
Adding counts before operators
You can add a number before double operator actions to set a number of times it should occur.
count
- number of occurrencesoperator
operator
- operation to be carried out
eg. 4
d
d
will delete 4 lines, or 8
y
y
will copy 8 lines.
Adding counts before motions
You can add a number before the motion part to repeat the operation on that motion a number of times.
operator
- the operation to be carried outcount
- the number of occurrences.motion
- how far or what to act on.
eg. d
6
w
will delete 6 words, or d
4
j
will delete 4 lines downwards.