Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surround: Keep HTML attributes when changing tags #1938

Closed
wmaurer opened this issue Jul 21, 2017 · 3 comments
Closed

Surround: Keep HTML attributes when changing tags #1938

wmaurer opened this issue Jul 21, 2017 · 3 comments

Comments

@wmaurer
Copy link

wmaurer commented Jul 21, 2017

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Feature request:
I'd like to be able to use surround to change a tag, but keeping the existing attributes.
This functionality exists in the official vim-surround:
https://stackoverflow.com/a/31098722/664533
tpope/vim-surround#131

e.g.

<h2 class="foo>b*ar</h2>

cstth3> - changes h2 to h3, removes attributes - current behaviour
cstth3 ENTER - changes h2 to h3, keeps class attribute

Apart from that, VSCodeVim surround is great!

@knpwrs
Copy link

knpwrs commented Nov 17, 2017

Asciinema recording of the desired behavior: https://asciinema.org/a/miZYWNYNIYFQTcDDifXgMtBW6

@dum3ng
Copy link

dum3ng commented Aug 22, 2018

I think this is a very useful feature when editing html and jsx code.
But after years this has not been added.
Hope you can add this feature someday.

@esetnik
Copy link
Contributor

esetnik commented Aug 31, 2018

I would love this too. In my opinion tag replacement should by default preserve attributes. It's rare for me that I want to replace tags and simultaneously wipe the attributes.

xconverge added a commit that referenced this issue Oct 6, 2018
…ibutes

fixes #1938 Allow to retain attributes when using surround
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants