Just a quick post to remind myself in the future how to setup different tab styles for different languages in vim. If you’re like me, you’ll use multiple languages and depending on the language the recommended tab style will differ. For example, in Go it’s recommended to use actual tabs but in Haskell it’s recommended to use spaces for tabs.
As a result of these differing opinions I’ve had to setup my .vimrc to change depending on the language so I thought I’d post the one-liner I put in my .vimrc to change for Haskell (as real tabs are the default in Vim).
autocmd filetype haskell setlocal shiftwidth=4 tabstop=4 expandtab