Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Suppose I have:

<div id="help">

How do I select the whole block, starting from <div id="help">, in Vim? Thanks!

share|improve this question

2 Answers 2

up vote 3 down vote accepted

vat, as in Heptite's answer is the way to go.

Note that, depending on where the cursor is, you may need to type at a few more times until the whole <div> is selected.

Supposing the cursor is in a <td> you'd need vatatatat to select the whole <div>:

<div>      ^  at
  <table>  |  at
    <tr>   |  at
      <td> | vat

Another option would be to search backward for di(v) or he(lp) and select the whole tag with vat:

share|improve this answer

Place your cursor within the opening or the closing tag and type "vat".


:help text-objects
:help v_at
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.