Skip to content

Instantly share code, notes, and snippets.

@lbolla
Created October 15, 2011 09:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbolla/1289349 to your computer and use it in GitHub Desktop.
Save lbolla/1289349 to your computer and use it in GitHub Desktop.
Haskell VIM files
" Add to .vimrc
" Need to have .vim/compiler/ghc.vim
augroup HSK
au Bufenter *.hs compiler ghc
autocmd FileType haskell setlocal formatoptions+=t
autocmd 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.html
setlocal expandtab
setlocal tabstop=8
setlocal shiftwidth=8
setlocal textwidth=79
" Add to .vim/syntax/haskell.vim
" From Good Haskell Style http://urchin.earth.li/~ian/style/haskell.html
syn cluster hsRegions add=hsImport,hsLineComment,hsBlockComment,hsPragma
syn cluster hsRegions add=cPreCondit,cCppOut,cCppOut2,cCppSkip
syn cluster hsRegions add=cIncluded,cDefine,cPreProc,cComment,cCppString
syn match tab display "\t" containedin=@hsRegions
hi link tab Error
syn match trailingWhite display "[[:space:]]\+$" containedin=@hsRegions
hi link trailingWhite Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment