nvim-emmet icon indicating copy to clipboard operation
nvim-emmet copied to clipboard

Support remove tag

Open kocv59 opened this issue 4 months ago • 4 comments

VSCode has "Emmet: Remove Tag" which was very useful it deleted a tag and indents what's inside it. I miss that feature can this be added to the language server?

kocv59 avatar Aug 20 '25 21:08 kocv59

Doesn't dst (delete surround tag) with a plugin like https://github.com/kylechui/nvim-surround do the job? There's also https://github.com/tpope/vim-surround. Those are very common in neovim setups.

olrtg avatar Aug 20 '25 22:08 olrtg

I tried them but it's a simple implementation and ruin the indentation and formatting because they don't understand html like emmet does. And if you don't need other features of those plugins they shouldn't be necessary for having good html manipulation.

Wrap with abbreviation and remove tag are common and inverse of each other. If you wrap then remove or remove then wrap the start and end text should be same. Using another plugin won't be able to integrate both features in such a close way.

kocv59 avatar Aug 20 '25 22:08 kocv59

Tell me more about your current setup or why do you need this.

I tried them but it's a simple implementation and ruin the indentation and formatting because they don't understand html like emmet does. And if you don't need other features of those plugins they shouldn't be necessary for having good html manipulation.

I disagree, those plugins and specially the ones that are written in lua probably leverage treesitter, so they have a very precise understanding of the source structure. Maybe there's a bug and that's why the formatting is messed up. Even still, nothing that a formatter cannot fix.

Wrap with abbreviation and remove tag are common and inverse of each other. If you wrap then remove or remove then wrap the start and end text should be same.

I kind of agree in this in the sense of completeness that we should have the feature that does the opposite, but the feature already exists in other plugins that most people use in neovim, so I'm wondering, why duplicate it? (I'm saying this because, if we can get away not implementing this it will be better)

As I also said in other issues, I'm not using right now neovim so I'm not contributing to the neovim plugin right now. But of course I'm down to merge PRs.

olrtg avatar Aug 20 '25 23:08 olrtg

@kocv59 Thanks for making this request. I was following the Emmet lesson on The Odin Project and wondering why I could not do this.

@olrtg Thanks for the suggestion on additional plugins, I'll see what I can do with nvim-surround for the time being (even if it's forever or using another editor). Extremely ignorant but genuinely curious indeed question incoming: how exactly does nvim-emmet and by extension, emmet-language-server not have remove tag if it leverages [vscode-emmet-helper](https://github.com/microsoft/vscode-emmet-helper)? As in, what's the technical nuisance behind that?

Very useful thread so far, thanks for your collective time.

wolfdaemon avatar Sep 03 '25 02:09 wolfdaemon