Sublime Forum

Snippet Implentation Error

#1

I have been able to create a few snippets that work well. This snippet doesn’t work for some reason and it seems like a very simple implementation.

<snippet>
                <content><![CDATA[
<script>
$(document).ready(function() {
   $0
});
</script>
]]></content>
                <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
                <tabTrigger>jqdr</tabTrigger>
               <!-- Optional: Set a scope to limit where the snippet will trigger -->
                <!-- <scope>source.python</scope> -->
                <description>jQuery document.ready</description>
</snippet>

When I type the trigger text and tab the trigger text disappears but the snippet doesn’t appear.

If I try initializing by using the Ctrl+Shift+P and finding the snippet I receive an error:
Error Parsing Content for snippet
Packages/User/jqDocReady.sublime-snippet: Empty Key

I am running this on a Windows Vista PC, running SublimeText 2 rev 2181.

0 Likes

#2

You have to escape the $ with a ‘’

0 Likes

#3

Works Perfectly. Thank you very much.

Is there a reference somewhere that says which characters need to be escaped?

0 Likes