Something went wrong. Try again.
my experiments with nvim
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031function! s:OverwriteBuffer(output) let winview = winsaveview() silent! undojoin normal! gg"_dG call append(0, split(a:output, '\v\n')) normal! G"_dd call winrestview(winview)endfunction
function! s:RunStylishHaskell() let output = system("stylish-haskell" . " " . bufname("%")) let errors = matchstr(output, '\(Language\.Haskell\.Stylish\.Parse\.parseModule:[^\x0]*\)') if v:shell_error != 0 echom output elseif empty(errors) call s:OverwriteBuffer(output) write else echom errors endifendfunction
set formatprg=stylish-haskellset makeprg=hlint
augroup HaskellLint autocmd! autocmd BufWritePost *.hs | call s:RunStylishHaskell() | silent make! <afile> | silent redraw! autocmd QuickFixCmdPost [^l]* cwindowaugroup END