Neovim text objects: the shortcuts nobody tells beginners

·cheatly.dev

You know operators (d, c, y) and you know motions (w, $, f). Text objects are the third piece — and they're the one that makes people say "oh, that's why Vim is fast."

A text object selects a chunk of text by structure: a word, a sentence, everything inside quotes, everything inside parentheses. Combine them with operators and you get surgical editing that doesn't care where your cursor is.

Inner vs Around

Every text object comes in two flavors:

The Most Useful Text Objects
ciw
Change inner word — delete the word and enter insert mode
caw
Change a word — includes the space after it
ci"
Change inside double quotes
da"
Delete around double quotes (contents + the quotes themselves)
ci(
Change inside parentheses
di{
Delete inside curly braces
yap
Yank (copy) around paragraph
dip
Delete inner paragraph
cit
Change inside HTML/XML tag
vi[
Visually select inside square brackets

Why they're powerful

The key insight: your cursor doesn't have to be on the delimiter. Type ci" anywhere inside a quoted string and it clears the contents and drops you into insert mode. You don't need to navigate to the opening quote first.

Same with ci( — cursor anywhere inside the parentheses, the whole contents get replaced. This is why experienced Vim users rarely navigate to exact positions before editing. They jump roughly to the right area and let text objects handle the precision.

Common real-world uses

Text objects work with visual mode too. Press v then i" to select inside quotes, ip to select a paragraph, i{ to select inside braces. Great for when you want to see what you're about to operate on before committing.
You can nest these: ci( inside function(calculateTotal(items)) changes just the inner parens. Press . to repeat the same change elsewhere.

For the full reference, see our Neovim cheatsheet and the motions deep dive.