有没有快速删除vscode中的HTML标签对的方法?

Is there a quick way to delete an HTML tag pair in vscode?

例如之前:

<div>
    <div>Titles</div>
    <div>Description</div>
</div>

之后:

    <div>Titles</div>
    <div>Description</div>

使用Emmet: Remove Tag命令:

使用editor.emmet.action.removeTag为此设置一个键绑定:

{
    "key": "ctrl+shift+k",
    "command": "editor.emmet.action.removeTag"
}

请注意,vscode v1.63 也有改进(根据 OP 的要求)删除已删除标签所在的行。它现在可以在 Insiders Build 中使用。参见

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.

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