-
Notifications
You must be signed in to change notification settings - Fork 59
Customize
eagletmt edited this page Mar 3, 2012
·
13 revisions
ghcmod.vim passes these options to GHC via ghc-mod.
By default, ghcmod.vim doesn’t pass any GHC options.
Example: passing -idir1 and -idir2 to GHC
let g:ghcmod_ghc_options = ['-idir1', '-idir2']ghmod.vim passes these options to hlint via ghc-mod.
By default, ghcmod.vim doesn’t pass any hlint options.
Example: passing '--ignore=Redundant $' to hlint
let g:ghcmod_hlint_options = ['--ignore=Redundant $']The highlight group used in :GhcModType.
By default, the Search group is used.
See :help :highlight for details on Vim’s highlighting.
Example: highlighting sub-expressions with yellow background
hi ghcmodType ctermbg=yellow
let g:ghcmod_type_highlight = 'ghcmodType'Put the below in your ~/.vimrc.
When you write *.hs buffer to a file, both check and lint are run.
autocmd BufWritePost *.hs call s:check_and_lint()
function! s:check_and_lint()
let l:qflist = ghcmod#make('check')
call extend(l:qflist, ghcmod#make('lint'))
lcd `=expand('%:p:h')`
call setqflist(l:qflist)
lcd -
cwindow
endfunctionIf you like asynchronous checking, put the below instead.
autocmd BufWritePost *.hs call GhcModCheckAndLintAsync