Reputation: 3079
I am using the latest Vim in Ubuntu and Vimrc by Vincent Driessen of nvie.com. How do I highlight the entire section between matching pair of div and /div? The DIV tag on the same line is highlighted when I am on < of the DIV tag, but I want to highlight the entire section, to see if divs are matched all over the page, one by one.
Upvotes: 6
Views: 1926
Reputation: 419
On the <div>
type: v
a
t
v
: Starts visual mode (selects text).
a
: Means "a" text object, including the surrounding delimiters (in this case, the and tags themselves).
t
: Stands for "tag" and tells Vim to select the entire block within and including the matching tags.
So, when you press vat, Vim:
Selects the entire section between the matching <div>
and </div>
tags.
Highlights the block, including the tags themselves.
Upvotes: 0