title: Configure Build System to be automatically chosen based on file extension
body: <p>I have created a new Build System to run GolfScript programs. The definition is the following:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
      &quot;cmd&quot;: [&quot;ruby&quot;, &quot;D:\\w\\sublime\\golfscript.rb&quot;, &quot;$file&quot;]
  }
  </code></pre>
  <p>This works, but I have to manually switch the Build System from &quot;Automatic&quot; to &quot;golfscript&quot; whenever I need to use this and then switch it back to be able to run Ruby, Python, etc.</p>
  <p>I'd like to make my Build System be automatically applied when I have a <code>*.gs</code> file open.</p>
  <p>I have read <a href="https://web.archive.org/web/20190820014035/http://sublimetext.info/docs/en/reference/build_systems.html" rel="nofollow noreferrer">some</a> <a href="https://web.archive.org/web/20191003053146/http://docs.sublimetext.info/en/latest/reference/build_systems.html" rel="nofollow noreferrer">docs</a> and got the idea that I can use a <em>selector</em> in order to achieve this, so I added a selector to the existing configuration:</p>
  <pre class="lang-js prettyprint-override"><code>{
      &quot;cmd&quot;: [&quot;ruby&quot;, &quot;D:\\w\\sublime\\golfscript.rb&quot;, &quot;$file&quot;],
      &quot;selector&quot;: &quot;source.gs&quot;
  }
  </code></pre>
  <p>After reading even more docs/examples, I could not figure out how to tell sublime what the selector is actually about.</p>
  <p>How can I configure the <em><code>source.gs</code></em> selector to point to <code>*.gs</code> files?</p>