Reputation: 17505
I've wrote my first Sublime Text 3 snipped, registering it with prn
trigger and limiting it to PHP only:
<snippet>
<content><![CDATA[
echo '<pre>'.print_r(${1:\$variable}, TRUE).'</pre>';
die();
]]></content>
<tabTrigger>prn</tabTrigger>
<scope>source.php</scope>
</snippet>
When I open any .php
file and type prn
, eveything is fine -- my snippet appears as first and I can press Tab
or Enter
to place it in the editor, at cursor position:
However, no matter, what I do, this snippet is not shown in "Goto anywhere" dialog (the one, that appears after selecting Tools > Snippets...
. When I type prn
in that dialogs, I see only four items brought by snippets packages installed by me:
What am I missing? Are there any special requirements for snippets to appear in "Goto anywhere" dialog? Or do I have some unnoticed bug in my snipped code?
I've read "Snippets" chapter in Sublime Text Unofficial Documentation thoroughly, as well as "Working With Code Snippets In Sublime Text" blog article in hongkiat.com Blog. Unfortunatelly, I found no clue.
Upvotes: 2
Views: 171
Reputation: 6016
You need to introduce the name of the file the Snippet its saved in. In other words, if you also want to use prn in the Goto anywhere dialog, then you must save your file with that name.
Upvotes: 0