Change HTML tag in vim, but keeping the attributes (surround) -


let's have tag (and cursor @ *):

<h1 class="blah" id="moo">h*ello!</h1> 

i want change to:

*<h2 class="blah" id="moo">hello</h2> 

i.e. change type of tag, keep elements.

using surround.vim, do:

cst<h2> 

but changes html to:

*<h2>hello</h2> 

is changing tag possible, keeping attributes? surround documentation doesn't seem contain this...

i have xml.vim plugin (https://github.com/othree/xml.vim) . if had too, requirement rather easy.

just move cursor tag, press <leader>c (lowercase c), input new tagname, tag name changed.

if press <leader>c (big c), rename tag/element, original attributes removed.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -