I call them around and inside because that was an easy way to remember, but it’s
actually not “around” it’s “a [block]”, like “a word” or “a sentence”. Most of
the cases it works with “around”, but for example with sentence, it does not
make sense. When I refer to a
as “around”, keep in mind, it’s not around, but
close enough.
A full list from :help
:
aw a word (with white space)
iw inner word
aW a WORD (with white space)
iW inner WORD
as a sentence (with white space)
is inner sentence
ap a paragraph (with white space)
ip inner paragraph
ab a () block (with parentheses)
ib inner () block
aB a {} block (with braces)
iB inner {} block
at a <tag> </tag> block (with tags)
it inner <tag> </tag> block
a< a <> block (with <>)
i< inner <> block
a[ a [] block (with [])
i[ inner [] block
a" a double quoted string (with quotes)
i" inner double quoted string
a' a single quoted string (with quotes)
i' inner simple quoted string
a` a string in backticks (with backticks)
i` inner string in backticks
Basically if you are inside a ()
block:
- With
da(
you delete what’s inside the parentheses WITH the parentheses. - With
di(
you delete what’s inside the parentheses WITHOUT the parentheses.
A non-coding block like word, sentence or paragraph, if you are on a word:
- If you want to delete a word, you can use
daw
because it will delete the space after the word too. - If you want to change a word, you can use
ciw
, because it will delete the word, switch or insert mode, but the space after the word will be there, so you don’t have to type that extra space.
Same for paragraph, with dap
, it will delete the paragraph and a newline after
that, while dip
will delete the paragraph, but leaves the empty line at the
end and you will have two empty lines (paragraph has one empty line before and
one after).
While I’m producing valuable code, a
is mostly the same as “around”, that’s
why I call it “around”.