HTML/XML Tag Objects

it / at โ€” operate inside an HTML or XML tag pair.

Keys: it, at

it is the inner range between matching <tag>โ€ฆ</tag> pairs. at includes the tags themselves.

If you spend any time in markup, it and at pay rent. They jump out from the cursor to the nearest enclosing tag pair.

Change the contents of the surrounding tag
KeyNote
c
i
t
Delete the entire tag pair (open + content + close)
KeyNote
d
a
t
Visual-select the whole tag pair
KeyNote
v
a
t
it / at โ€” tag objects

Reference

Object Range
it Inside <tag>โ€ฆ</tag>
at Including <tag>โ€ฆ</tag>

Worked example โ€” cit and cat

HTML/XML tag objects.

Step 1 ยท
textobj.tags
Step 2 ยท cit ยท cit โ€” inner-tag content cleared.
cit โ€” inner-tag content cleared.

โ–ถ Try this in the simulator

See also: Bracket Text Objects, The Vim Grammar