I would like to wrap my selected html within a tag in VS code. How do I do that?
Embedded Emmet could do the trick:
Emmet: Wrap with Abbreviation
div
(or an abbreviation .wrapper>p
)Command can be assigned to a keybinding.
This thing even supports passing arguments:
{
"key": "ctrl+shift+9",
"command": "editor.emmet.action.wrapWithAbbreviation",
"when": "editorHasSelection",
"args": {
"abbreviation": "span"
}
},
Use it like this:
span.myCssClass
span#myCssId
b
b.myCssClass