3

I want c to trigger console.log()

The snippet I created has the correct syntax below and is in the correct folder paths according to these articles: http://www.hongkiat.com/blog/sublime-code-snippets/ | http://sublimetext.info/docs/en/extensibility/snippets.html

enter image description here

<snippet>
    <content><![CDATA[
console.log(${1:this});
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>c</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope>source.JavaScript</scope>
</snippet>

I have the snippet file created inside of my User folder, as well a User/Javascript folder. It has the correct sublime-snippet extension as well.

Went through the trouble of installing the JavaScript default snippets, but now instead of just console it does console.dir(obj) who uses that lol? Anyways if I can't create my own custom snippets, how can I edit this one?

Leon Gaban
  • 2,855

1 Answers1

5

The base scope for JavaScript files in Sublime is source.js, not source.javascript. You can find the complete scope at the cursor by hitting CtrlAltShiftP (Linux/Windows) or AltP (OS X).

MattDMo
  • 5,409