title: Adding the % to a tag automatically in haml and only in haml
body: <p>I asked about this previously here: <a href="https://stackoverflow.com/questions/18264368/add-the-on-tab-when-working-with-haml-on-vim">Add the % on tab when working with HAML on vim</a></p>
  
  <p>The solution there was okay, but it turns out that the function call is also being triggered in scss file types.</p>
  
  <p>Here's what I currently have:</p>
  
  <pre><code>function! s:haml_settings()
    iabbrev h1        %h1
    iabbrev p         %p
    iabbrev section   %section
  endfunction
  
  autocmd BufNewFile,BufRead *.haml setlocal filetype=haml
  autocmd FileType haml call &lt;sid&gt;haml_settings()
  </code></pre>
  
  <p>I'm pretty new to vim so please forgive me if I'm asking a noobie question.</p>
  
  <p>How do I make sure this function is only called in HAML files? Or if that can't be accomplished, how can I remap it so it only fires when I press <code>option-space</code> before a given tag? I'm on a mac so I have an option key.</p>
  
  <p>In other words: I'd like it if I could press <code>p&lt;space&gt;</code> then have the output be <code>%p</code> (with the space after it). Or I'd like to press <code>p&lt;option&gt;&lt;space&gt;</code> and have it output the same <code>%p</code>)</p>
  
  <p>I have tim popes vim-haml plugin, but it doesn't provide this kind of functionality.</p>
  
  <p>Thanks!</p>