Vim: Combining Movement and Editing Commands

Operators

Operators are commands that perform an action when combined with a motion or text object.

Operator Action
d Delete
c Change (delete and enter insert mode)
y Yank (copy)
> Indent right
< Indent left
g~ Swap case
gu Make lowercase
gU Make uppercase

Text Objects

Text objects are used with operators to act on structured pieces of text.

Object Description
iw Inner word
aw A word (includes surrounding space)
is Inner sentence
as A sentence
ip Inner paragraph
ap A paragraph
i( or i) Inside parentheses
a( or a) A pair of parentheses
i{ or i} Inside curly braces
a{ or a} A pair of curly braces
i" Inside double quotes
a" A pair of double quotes
it Inner XML/HTML tag
at A XML/HTML tag block

Common Combinations

Command Description
dw Delete to the start of the next word
d$ or D Delete to the end of the line
d0 Delete to the beginning of the line
diw Delete inner word
ciw Change inner word
ci" Change text inside double quotes
da( Delete a pair of parentheses and their content
yi{ Yank text inside curly braces
gUiw Make inner word uppercase
><motion> Indent right (e.g., >G to indent to end of file)
cit Change inner XML/HTML tag

Tips