Sublime Forum

How to tell what Snippet is being called?

#1

The default Sublime install doesn’t have very many HTML snippets. When I’m working on an HTML or PHP doc and I type “div” and press TAB a snippet gets run like this:

$1

I want to make some changes to the snippet, but as I’m looking through the folders, I can’t find any DIV snippets anywhere. Its definitely not in the HTML or PHP folder. How do I tell where it is so I can make changes?

0 Likes

#2

It’s a sort of a dynamic snippet coupled with a regex keybinding. The captured text from the regex keybinding is passed to a very generic snippet that does the inserting. The snippet itself lives in the XML package:

<!-- General HTML tags --> <binding key="/(?i:abbr|acronym|address|applet|area|b|base|big|blockquote|caption|center|cite|col|colgroup|cote|dd|del|dfn|div|dl|dt|em|fieldset|font|form|frame|frameset|h1|h2|h3|h4|h5|h6|i|ins|kbd|label|legend|li|link|map|noframes|object|ol|optgroup|p|pre|samp|select|small|span|strong|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|ul|var)/,tab" command="insertSnippet 'Packages/XML/tag.sublime-snippet' $1"> <context name="selector" value="text.html - source - meta.tag, punctuation.definition.tag.begin, meta.scope.between-tag-pair.html"/> </binding>

0 Likes