How do I progressively expand or contract a visual selection by text objects?
v3aw
In visual mode, repeating text object motions progressively expands the selection.
7 results for "iw aw"
v3aw
In visual mode, repeating text object motions progressively expands the selection.
:setlocal iskeyword+=-
The iskeyword option defines which characters are part of a "word" for motions like w, b, e, , and text objects like iw.
w vs W, b vs B, e vs E
Vim distinguishes between "words" (sequences of keyword characters) and "WORDS" (sequences of non-blank characters).
viw
How it works The command viw selects the word under the cursor in visual mode.
:set iskeyword+={char}
iskeyword defines which characters are considered word characters in Vim.
cw vs ciw
The cw and ciw commands both change a word, but they behave differently depending on cursor position.
editing #editing #text-objects #motions #normal-mode #productivity
v + repeated iw/aw/i(/a(/ip/ap
Once you enter visual mode, you can progressively expand your selection by typing increasingly larger text objects.
visual-mode #visual-mode #text-objects #editing #selection #productivity