Is there a way to keep context in tags with mini.surround? #1375
-
When working with html tags, by context I mean attributes <div class="cool" id="stuff">
...
</div> So in https://github.com/tpope/vim-surround for example I have two options to replace the div tag which is to replace it entirely with
The second option is keeping the class and id attributes which can be done with
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The |
Beta Was this translation helpful? Give feedback.
The
t
(tag) surrounding will always delete/replace the whole tag with all attributes inside. The approach here for adjusting only tag name is to create a separate surrounding specifically for this. For example, underT
surrounding as described here. With this, you cansrTT
to replace tag name with another tag name.