Hello all,
1. Can I use JSON for writing snippets?
2. How can I make the description as on the screenshot?
<snippet>
<content><![CDATA[if (${1:true}) {${0:$TM_SELECTED_TEXT}};]]></content> <!-- The text to insert. -->
<tabTrigger>if</tabTrigger> <!-- Sublime parses this and displays it in the snippet menu as "i,f, Tab" this is what you are looking for. -->
<scope>source.js</scope> <!-- the scope of the snippet -->
<description>if</description> <!-- [Option] Add this to customize the description in the left hand portion of the snippet menu. Defaults to the name of the snippet file if missing. -->
</snippet>tstrokes wrote:2. How can I make the description as on the screenshot?
Currently this is the XML structure of a snippet.
- Code: Select all
<snippet>
<content><![CDATA[if (${1:true}) {${0:$TM_SELECTED_TEXT}};]]></content> <!-- The text to insert. -->
<tabTrigger>if</tabTrigger> <!-- Sublime parses this and displays it in the snippet menu as "i,f, Tab" this is what you are looking for. -->
<scope>source.js</scope> <!-- the scope of the snippet -->
<description>if</description> <!-- [Option] Add this to customize the description in the left hand portion of the snippet menu. Defaults to the name of the snippet file if missing. -->
</snippet>
jps wrote:Snippet key bindings are not shown in the menu on OS X, because Cocoa is unable to show multi-key key bindings in its menus. I plan to spend some time looking into doing menus the deprecated (Carbon) way on OS X in the future, as it's more flexible.
Users browsing this forum: Clams and 4 guests