title: Autocommands for Matlab in vim?
body: <p>I use several different programming languages every day, and I'd like to have different tab widths (in spaces) for each.  For example:  I use the "standard" 2 spaces for Ruby, but all our existing Matlab code uses 4 spaces.</p>
  
  <p>I have this from my personal <code>~/.vimrc</code>:</p>
  
  <pre><code>augroup lang_perl
      au!
      set tabstop=4 " tabstop length N in spaces
      set shiftwidth=4 " make &gt;&gt; and friends (&lt;&lt;, ^T, ^D) shift N, not the default 8
      set expandtab " Use spaces instead of tabs
  augroup END
  
  augroup lang_ruby
      au!
      set tabstop=2 " tabstop length N in spaces
      set shiftwidth=2 " make &gt;&gt; and friends (&lt;&lt;, ^T, ^D) shift N, not the default 8
      set expandtab " Use spaces instead of tabs
  augroup END
  </code></pre>
  
  <p>Those work, but the following doesn't:</p>
  
  <pre><code>augroup lang_matlab
      au!
      set tabstop=4 " tabstop length N in spaces
      set shiftwidth=4 " make &gt;&gt; and friends (&lt;&lt;, ^T, ^D) shift N, not the default 8
      set expandtab " Use spaces instead of tabs
  augroup END
  </code></pre>
  
  <p>I really don't understand how <code>augroup lang_ruby</code> figures out that I'm editing a Ruby file.  (My searches brought up <code>ftdetect</code>, but the solution wasn't obvious.)  It doesn't seem like <code>vim</code> knows that I'm editing Matlab using <code>augroup lang_matlab</code>.  What do I change to make this work?</p>