title: Get Visual Studio Code to syntax highlight extensionless files as bash scripts?
body: <p>I have started writing some bash scripts to augment git, using <a href="https://code.visualstudio.com/" rel="noreferrer">Visual Studio Code</a> and I want the editor to use syntax highlighting when doing so.</p>
  
  <p>The files do not have an extension, or git won't pick them up as additional commands.</p>
  
  <p>Here's an example name of such a script: <code>git-review</code></p>
  
  <p>So the question is, how can I configure Visual Studio Code to use Bash syntax highlighting for these files?</p>
  
  <p>If I rename the file from inside Visual Studio Code to something with <code>.sh</code>, like <code>git-review.sh</code> and then back to no extension (<code>git-review</code>), Visual Studio Code seems to remember this and show syntax highlighting but any new files I add to the folder is highlighted as plain text (until I do the renaming dance). Visual Studio Code seems to remember this even if I close the file and restart Visual Studio Code and reopen the file. For how long I do not know.</p>
  
  <p>I can live with plain text files that for some reason doesn't have an extension being highlighted as bash scripts, but obviously, if there is a way to make Visual Studio Code even smarter, like looking at the first line for <code>#!/bin/sh</code> then that would be even better.</p>
  
  <p>I tried using the "Configure file association for '.xyz'" to see how these associations were stored in the settings file and found that this correctly applies Bash highlighting to <code>.xyz</code> files:</p>
  
  <pre class="lang-json prettyprint-override"><code>"files.associations": {
      "*.xyz": "shellscript"
  },
  </code></pre>
  
  <p>However, this does not:</p>
  
  <pre class="lang-json prettyprint-override"><code>"files.associations": {
      "*.": "shellscript"
  },
  </code></pre>
  
  <p>nor does this:</p>
  
  <pre class="lang-json prettyprint-override"><code>"files.associations": {
      "*": "shellscript"
  },
  </code></pre>
  
  <p>Is there any way to coax this setting into working for extensionless files?</p>
  
  <p>This is Visual Studio Code for Windows if that matters at all.</p>