2

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>
              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> and I get

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

from: https://stackoverflow.com/questions/65908860/vim-change-multiline-html-tags-with-vim-surround

2
  • I experimented with it a little bit... It looks like cst<h1> using t instead of < helps, though in my case it reindents the block as well. It looks like < was supposed to be a synonym for t, but they don't seem to behave the same... Still not 100% sure of what's happening here. – filbranden Jan 26 at 21:36
  • 1
    The thing is, the text-object i< actually use the part inside the brackets (the p part of the tag), so that could be related. – D. Ben Knoble Jan 26 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.