Vim / Neovim Editing: Operators and Text Objects

Delete, change, yank, repeat, and target text precisely with motions and text objects.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Core operators

Combine operators with motions for powerful edits.

Delete with a motion

Delete words, lines, or ranges.

vimANYvimdeleteoperators
vim
dw  d$  dd
Notes

`d` becomes much more powerful when combined with motions.

Change with a motion

Delete target text and enter insert mode.

vimANYvimchangeoperators
vim
cw  c$  cc
Notes

`c` is one of the most productive editing operators for code and prose.

Yank with a motion

Copy text into a register.

vimANYvimyankoperators
vim
yw  y$  yy
Notes

`y` copies text; pair it with `p` or `P` to paste later.

Repeat the last change

Run your last edit again.

vimANYvimrepeatproductivity
vim
.
Notes

The dot command is a major productivity multiplier in modal editing.

Text objects

Operate on meaningful text units instead of counting characters.

Operate on a word

Change, delete, or yank the current word cleanly.

vimANYvimtext-objectsword
vim
ciw  diw  yiw
Notes

Text objects let you edit intentfully rather than character-by-character.

Operate inside quotes

Target a quoted string without touching delimiters.

vimANYvimtext-objectsquotes
vim
ci"  di"  yi"
Notes

Use `i` for inside and `a` for around when working with delimiters.

Operate inside delimiters

Edit text inside parentheses, braces, or brackets.

vimANYvimtext-objectsdelimiters
vim
ci(  ci{  da[
Notes

Essential for structured code editing.

Operate on a paragraph

Change, delete, or yank paragraph blocks.

vimANYvimtext-objectsparagraph
vim
cip  dip  yap
Notes

Useful in Markdown, prose, commit messages, and docs.

Counts, join, undo, and replace

Scale edits and recover cleanly.

Prefix commands with counts

Repeat a motion or edit multiple times.

vimANYvimcountsediting
vim
3w  5j  2dd
Notes

Counts work with many motions, operators, and macros.

Join lines

Merge lines cleanly.

vimANYvimeditinglines
vim
J  gJ
Notes

`J` joins with spacing; `gJ` joins without inserting extra whitespace.

Undo and redo

Walk backward and forward through edits.

vimANYvimundoredo
vim
u  <C-r>
Notes

These make experimentation safer when learning powerful edits.

Replace a single character

Overwrite one character without entering insert mode.

vimANYvimreplaceediting
vim
rX
Notes

Fast for typo fixes and punctuation changes.

Recommended next

No recommendations yet.