Reputation: 32986
How can I easily delete blocks of text surrounded by HTML tags?
Say I come across a block of text that is surrounded by <div>
tags. How can I easily delete everything within the tags, and the tags themselves, all at once?
Upvotes: 32
Views: 9997
Reputation: 15715
Text objects are your friends...
dat
: "delete around tag"dit
: "delete inside tag"There are also similar operations for changing the text (cat
and cit
) and selecting it visually (vat
and vit
).
Have fun!
Upvotes: 84