Home Download Buy Blog Forum Support

How to tell what Snippet is being called?

How to tell what Snippet is being called?

Postby jakobud on Wed Aug 04, 2010 8:36 am

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:

<div>$1</div>

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?
jakobud
 
Posts: 37
Joined: Wed Feb 17, 2010 6:05 pm

Re: How to tell what Snippet is being called?

Postby guillermooo on Wed Aug 04, 2010 10:39 am

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:

Code: Select all
   <!-- 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>
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am


Return to General Discussion

Who is online

Users browsing this forum: apessino and 15 guests