【问题标题】:How to - in Visual Studio Code - wrap selection with a tag (div, preferably)如何 - 在 Visual Studio Code 中 - 使用标签(最好是 div)包装选择
【发布时间】:2020-05-05 01:51:27
【问题描述】:

有没有办法在 Visual Studio Code 中选择几行代码,并以某种方式自动用 div(或其他标签)包装它们?

感谢您的帮助

米索斯

【问题讨论】:

标签: html visual-studio-code tags


【解决方案1】:

您可以使用Emmet: Wrap Individual lines with abbreviation

如果你有一个固定的标签你想用来包装你可以在keybindings.json添加一个键盘快捷键

  {
    "key": "shift+alt+d",
    "when": "editorTextFocus && editorLangId == html",
    "command": "editor.emmet.action.wrapIndividualLinesWithAbbreviation",
    "args": { "abbreviation": "div" }
  }

【讨论】:

    猜你喜欢
    • 2010-09-16
    • 1970-01-01
    • 2010-10-10
    • 1970-01-01
    • 1970-01-01
    • 2017-04-02
    • 2016-09-25
    • 2021-07-10
    • 2019-02-27
    相关资源
    最近更新 更多