0

Is there a way to select a few lines of code in Visual Studio Code and, somehow, automatically wrap them with a div (or other tag)?

Thank you for any help

Mitsos

mitsos
  • 23
  • 7

1 Answers1

0

You can use Emmet: Wrap Individual lines with abbreviation.

If you have a fixed tag you want to use to wrap you can add a keyboard shortcut in keybindings.json

  {
    "key": "shift+alt+d",
    "when": "editorTextFocus && editorLangId == html",
    "command": "editor.emmet.action.wrapIndividualLinesWithAbbreviation",
    "args": { "abbreviation": "div" }
  }
rioV8
  • 24,506
  • 3
  • 32
  • 49