title: How can I configure Vim for 2 different languages?
body: <p>I am currently using Vim for Python, and would like to start using it while I learn Ruby too.</p>
  
  <p>Is there a way to configure the vimrc file so that different settings apply depending on the filetype currently being worked on?</p>
  
  <p>For example, my vimrc is currently set to have an indentation of 4 spaces, which I would like to be 2 spaces for Ruby files.  Additionally, I would like the syntax Ruby syntax highlighting to be on when working on ruby files, and Python syntax highlighting for python files.</p>
  
  <p>I stumbled across this for defining the tab spaces:</p>
  
  <pre><code>autocmd FileType python set tabstop=8|set shiftwidth=4|set expandtab
  autocmd FileType ruby set tabstop=8|set shiftwidth=2|set expandtab
  </code></pre>
  
  <p>Is there something similar for syntax highlighting?</p>