title: vim red highlight $( )
body: <p>I was writing a script when I decided to move the functions to a lib file, but when I open the lib file all the <code>$(</code> and the consecutive <code>)</code> are red highlighted, here are some examples of the script</p>
  
  <pre><code>TAB="$(printf '\t')"
  percent=$(echo "scale=2; $number/$total*100" | bc | sed -e 's/\.[[:digit:]]*//g')
  if [[ -z $(grep $site/post $max_lim) ]];then
  </code></pre>
  
  <p>The filetype is conf but I've set it as sh syntax in .vimrc</p>
  
  <p>Any idea of what is happenning?</p>
  
  <p>Thank you</p>
  
  <hr>
  
  <p>Edit: Thanks for the quick answers, I found that this line makes vim match the files with the extension specified behind the <code>*</code> with the syntax sh</p>
  
  <pre><code>au BufReadPost * set syntax=sh
  </code></pre>
  
  <p>I've also thought that using shebang in the libraries was not allowed, but is a nice solution</p>
  
  <p>Anyway using <code>g:is_bash</code> in .vimrc returns an error of pattern not found</p>
  
  <p>So what I would like to do is as I only write in bash, to vim recognize any file without extension as bash</p>