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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With