How to use dollar signs/JQuery with Sublime Text 2 Snippets?

sublimetext2

Solution

Did you try escaping the `$` with a `\`?

For instance in PHP, the $GLOBALS snippet is:

<snippet>
    <content><![CDATA[\$GLOBALS['${1:variable}']${2: = }${3:something}${4:;}$0]]></content>
    <tabTrigger>globals</tabTrigger>
    <scope>source.php</scope>
    <description>$GLOBALS['…']</description>
</snippet>

As you can see in `<content>`, $GLOBALS is expressed as \$GLOBALS. This is because $ is a symbol used for fields like ${1:variable}.

Problem

I am trying to create some code "Snippets" with Sublime Text2 and everything works fine except when I try and add jQuery code. Apparently any "Snippets" code that includes lines that begin with a `$` will simply not work. I couldn't find any answers online regarding this.

Original source