emacs-evil / evil-surround

you will be surrounded (surround.vim for evil, the extensible vi layer)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keep attributes when changing tag

tam5 opened this issue · comments

Vim surround keeps the html/xml attributes of the previous surrounding tag, while optionally removing the attributes if the prompt is ended with >.

From the doc:

If t or < is used, Vim prompts for an HTML/XML tag to insert. You may specify
attributes here and they will be stripped from the closing tag. If replacing a
tag, its attributes are kept in the new tag. End your input with > to discard
the those attributes. If <C-T> is used, the tags will appear on lines by
themselves.

Any suggestions on how to implement?

that's a reasonably complex feature. I think you have to read the whole source code to wrap your head around the logic.