Skip to content
eagletmt edited this page Mar 2, 2012 · 13 revisions

Auto-checking on writing

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
endfunction
Clone this wiki locally