Training plan › Selection and objects
Text objects
iw, i", i(, ap: operate on “things”, not positions.
A text object describes a thing: a word (iw), the inside of quotes (i"), the inside of parentheses (i(), a paragraph (ap). i is inner and a is around (delimiters included). They combine with operators: ciw changes the word, di( empties the parentheses, yap copies the paragraph. And it does not matter where the cursor is inside the object. LazyVim adds, via mini.ai, objects for arguments (ia/aa) and functions (if/af).
7 steps · 6 min · 90 XP
- Change a word from any letter: ciw
- Inside quotes: ci"
- Inside parentheses: di(
- One argument: daa (mini.ai)
- A paragraph: dap
- Inside braces: yi{
- A whole function: daf (mini.ai)