I want to create an snippet when triggered it will surround the given text. Currently my snippet is:
{
\"Function Creator Helper\": {
\"prefix\": \"_w
If somebody wants to know, it works like that for me :
I created two same snippet which only matches when I'm in html or php file (just create two snippets files in your snippets folder "php.json" and "html.json" it works for any languages) and added this code inside :
"unicommentary": {
"prefix": "unicommentary",
"body": " ${0}",
"description": "Creates a universal comment to disable both html and php."
}
The ${TM_SELECTED_TEXT}
tag works when you select some text and trigger your snippet by the Insert Snippet
command, you can't just write on selected text.
When you want to use this, select the text you want in your snippet, press Ctrl + Shift + P and select Insert snippet
then, type the name of your snippet, press enter and there you go !