Haskell and VIM
I had to tinker quite a bit before finding a decent configuration for vim to edit Haskell files.
Here are the packages and config files I use:
- Haskell mode: interaction with Haddock, compiler integration, and other general settings.
- Indentation: proper source code indentation.
- More configs to enforce good style (no tabs, tabstops, etc.): " Add to .vimrc" Need to have .vim/compiler/ghc.vimaugroup HSKau Bufenter *.hs compiler ghcautocmd FileType haskell setlocal formatoptions+=tautocmd FileType haskell let b:ghc_staticoptions = '-Wall -Werror'augroup END" Add to .vim/ftplugin/haskell.vim" From Good Haskell Style http://urchin.earth.li/~ian/style/haskell.htmlsetlocal expandtabsetlocal tabstop=8setlocal shiftwidth=8setlocal textwidth=79" Add to .vim/syntax/haskell.vim" From Good Haskell Style http://urchin.earth.li/~ian/style/haskell.htmlsyn cluster hsRegions add=hsImport,hsLineComment,hsBlockComment,hsPragmasyn cluster hsRegions add=cPreCondit,cCppOut,cCppOut2,cCppSkipsyn cluster hsRegions add=cIncluded,cDefine,cPreProc,cComment,cCppStringsyn match tab display "\t" containedin=@hsRegionshi link tab Errorsyn match trailingWhite display "[[:space:]]\+$" containedin=@hsRegionshi link trailingWhite Error
You can also have them bundled all together.
Tagged gist, haskell, vim
