Embedded Emmet could do the trick:
- Select text (optional)
- Open command palette (usually Ctrl+Shift+P)
- Execute
Emmet: Wrap with Abbreviation
- Enter a tag
div
(or an abbreviation .wrapper>p
)
- Hit Enter
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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…