How can I define my own custom surround template that I can use to wrap around a selection of javascript code followed by reformat.
I've used Alt + Cmd + T
to bring up this option panel.
Go to Settings/Live Templates, create a new Live template, specify abbreviation, description and contexts, check Reformat according to code style.
And now the important part. The Live template content must contain $SELECTION$
variable for it to be applicable for Surround with action. For instance:
console.log($SELECTION$);
After you save the template you should see it in the pop-up list next time you use the Surround With action.
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