vim change multiline html tags with vim-surround

Viewed 126

I would like, using vim-surround to convert this

            <p>
            ^currsor
              Issues reported by users from the
              <a href="https://re.fr"> https://re.fr</a>
              they will create an issue.
            </p>

into that

            <h1 class="important">
              Issues reported by users from the
              <a href="https://re.fr"> https://re.fr</a>
              they will create an issue.
            </h1>

I've been using in command mode: cs<<h1 class="important"> and I get

            <h1 class="important">p</h1>
            ^currsor
              Issues reported by users from the
              <a href="https://re.fr"> https://re.fr</a>
              they will create an issue.
            </p>

3 Answers

you can just do ...

cst<h1 class="important">

"change surrounding tag "

And now i have surround to work:

3VS<h1>

will do the trick for you

Without using the surround plugin i would do this:

:%s/p>/h1>
Related