emmet-vim
emmet-vim copied to clipboard
Feature request: Change tag
A feature I find missing in this plugin is changing tag type.
Let's say I have a <div>
:
<div class="header>
...
</div>
At some point I decide to change <div>
to <head>
:
<head class="header">
...
</head>
I do this operations a lot whenever I'm writing HTML. So far I don't know of any quick way to do it other than editing both closing and opening tags separately and that can get quite hard, when the opening and closing tag are far away. Would be great if Emmet supported this.
Note: I created a feature request for that in the main Emmet repo, but was told that this is currently not suited for the main Emmet tool, but should rather be implemented as a plugin feature.
tpope's vim-surround plugin offers a mapping (cst -- "c"hange "s"urrounding "t"ag) to facilitate this operation
tpope's vim-surround plugin offers a mapping (cst -- "c"hange "s"urrounding "t"ag) to facilitate this operation
That works differently, because it changes both the tag and any content inside the tag: cit
only contents between the tags, cat
both contents between the tags and the tags themselves.
The alternative I found is vim-matchup plugin, in which you just change a name of closing or starting tag and it automatically updates the other one. Works super good for me.
vim-matchup is not changing the tag for me, for information, take a look at https://github.com/AndrewRadev/tagalong.vim
doesn't emmet-update-tag (ctrl y + u) do the job?