This plugin allows you to wrap one or multiple selections with symbol/combination of symbols. You can find it in marketplace
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter:
ext install konstantin.wrapSelection
Select something → ctrl+shift+P → «Wrap selected text»
or
press ', ", «, ], < or ) — both opening or closing symbol would work
Through «Wrap selected text» you can also use multiple symbols, i.e.:
{{
→{{text}}
<!--
→<!--text-->
<%
→<%text%>
You can also do custom patterns through your settings:
{
"wrapSelection.patterns": {
"log": "console.log(`${text}`, ${text})",
"promise": "new Promise((yeah, nah) => yeah(${text}))",
"=>": "() => ${text}"
}
}
And then you can do ctrl+shift+P → «Wrap selected text» → log:
selection
will become
console.log(`selection`, selection);
Create a ticket here or insult me at mail[at]konstantin[dot]io