I am currently using Vim for Python, and would like to start using it while I learn Ruby too.

Is there a way to configure the vimrc file so that different settings apply depending on the filetype currently being worked on?

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.

I stumbled across this for defining the tab spaces:

```
autocmd FileType python set tabstop=8|set shiftwidth=4|set expandtab
autocmd FileType ruby set tabstop=8|set shiftwidth=2|set expandtab

```

Is there something similar for syntax highlighting?