Reputation: 997
For example, before:
<div>
<div>Titles</div>
<div>Description</div>
</div>
After:
<div>Titles</div>
<div>Description</div>
Upvotes: 44
Views: 30669
Reputation: 180649
Just a note that there is an improvement in vscode v1.63 to also (as the OP requested) remove the lines on which the removed tags reside. It works now in the Insiders Build. See
Emmet Remove Tag command improvement
The "Emmet: Remove Tag" command now removes empty lines around tags if they are the only tags on the line. It also now does not take into account empty lines when calculating the amount to reindent the lines.
See release notes: emmet remove tag improvements
<div> <- this entire line will be removed sonce only the tag on the line
<div>Titles</div>
<div>Description</div>
</div> <- this entire line will be removed
Upvotes: 2
Reputation: 65175
Use the Emmet: Remove Tag
command:
Setup a keybinding for this with editor.emmet.action.removeTag
:
{
"key": "ctrl+shift+k",
"command": "editor.emmet.action.removeTag"
}
Upvotes: 91