How to Have Language-Specific Settings in Vim
I wanted to set up Vim so that Coffeescript files would use 2 spaces for indentation. This was very simple:
- Create a file at
<language>is the language you want to modify. For Coffeescript, this is
coffee. The language name you should use is just the file extension.
- In this file, add your settings. In my
coffee.vim, I have
setlocal shiftwidth=2to make my tabs 2 spaces.
- Open up a file in that language and enjoy your language specific settings!