title: SublimeText2 Custom Scope
body: <p>I have a number of different types of projects that use similar code, and my goal is to make snippets and key bindings in SublimeText2 that only activate on a given project.</p>
  
  <p>So, for instance, I have <code>jsg1.html</code> through <code>jsg40.html</code>, and I also have <code>kwa1.html</code> through <code>kwa40.html</code>. Each of these two groups has code unique to them, and I want to create different snippets and key bindings for each.</p>
  
  <p>This has led me to want to create custom file-types, like <code>.kwa</code> and <code>.jsg</code>, so that I can create the snippets/key-bindings with a scope set to be those file types.</p>
  
  <p>However, I can't make it work. This is what I've tried:</p>
  
  <p>a.sublime-snippet</p>
  
  <pre><code>&lt;snippet&gt;
  &lt;content&gt;&lt;![CDATA[
  &lt;a href="$1" style="font-family: Segoe UI, Lucida Sans Unicode, Arial;  color:#2f6497; font-size:14px; text-decoration:underline;"&gt;$2&lt;/a&gt;
  ]]&gt;&lt;/content&gt;
  &lt;tabTrigger&gt;aj&lt;/tabTrigger&gt;
  &lt;scope&gt;source.jsg&lt;/scope&gt;
  &lt;/snippet&gt;
  </code></pre>
  
  <p>jsg.tmLanguage</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"    "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
    &lt;key&gt;fileTypes&lt;/key&gt;
    &lt;array&gt;
      &lt;string&gt;jsg&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;name&lt;/key&gt;
    &lt;string&gt;jsg&lt;/string&gt;
    &lt;key&gt;scopeName&lt;/key&gt;
    &lt;string&gt;source.jsg&lt;/string&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>Both of these files are in my <code>Packages/User</code> folder. However, I have a file, <code>test.jsg</code>, and the snippet won't activate in it.</p>
  
  <p>So the questions are:</p>
  
  <p>What's the best way to create custom scopes for groups of HTML files which will use the same key bindings and snippets? Is it creating a custom scope by creating a custom syntax for a new filetype? Or is there a better way? If this is the best way, why doesn't my snippet work in my <code>.jsg</code> files?</p>