I have the following snippet:
<snippet>
<content><![CDATA[
{{#_}}${1:$SELECTION}{{/_}}
]]></content>
<tabTrigger>i18n</tabTrigger>
<!-- What can I put in scope? -->
<scope>text.handlebars</scope>
</snippet>
But I only want it to be available within files that end in “.handlebars”. I want to do this because I want to overload the i18n tab trigger for several different filetypes. Right now, I am stuck with renaming the tab trigger for this particular case.
This question is very useful for existing scopes: Defining scope for custom Sublime Text 2 snippets
For your handlebars example, nrw / sublime-text-handlebars uses
text.html.handlebars. You’ll need the Handlebars.tmLanguage file to have the syntax.Edit: The scope name is defined by the
scopeNamekey in the syntax’s tmLanguage file. Again for your example, line 681 of Handlebars.tmLanguage:To create your own syntax definition, see this unofficial documentation article.
scopeNamesets the value that should be used for the scope key in the snippet definition.