vim-surround icon indicating copy to clipboard operation
vim-surround copied to clipboard

How to change tags in visual mode?

Open twmht opened this issue 12 years ago • 4 comments

hi,

here is an example:

<firm>
    <legend>Contace details</legend>
    <label>
        Email:
        <input type = "text" name = "email" /><br />
    </label>
</firm>

I want to change the <firm> into <form>

first, I select the body(multiple lines) surround in <firm> and let vim go to visual mode,

but how can I change <firm> to <form> in visual mode? (similar to cst in normal mode)

Thanks in advance:)

twmht avatar Feb 05 '13 07:02 twmht

+1

mplorentz avatar May 01 '13 21:05 mplorentz

What? Why can't you just leave visual mode?

tpope avatar Apr 02 '14 07:04 tpope

I think you can do this with dst or cst positioning the cursor is essential to this.

zirho avatar Jul 09 '16 16:07 zirho

I know the following is not what OP asked but it fits the question title: When in visual mode (block or line), is there a way to change the surrounding for each line?

Let's say I want to go from

<p>One</p>
<p>Two</p>
<p>Three</p>

to

<li>One</li>
<li>Two</li>
<li>Three</li>

Is there a way to do that in visual mode?

Currently, I do that in normal mode with cst< and repeat the command with dot from vim-repeat (thanks for all those great plugins!).

mb720 avatar Aug 27 '23 22:08 mb720