.vimrc 861 B

12345678910111213141516171819202122232425
  1. " Enable hlint and GHC via Cabal
  2. let g:ale_linters = {'haskell': ['hlint', 'my_cabal_ghc']}
  3. " ... only
  4. let g:ale_linters_explicit = 1
  5. " Don't lint until I save
  6. let g:ale_lint_on_text_changed = 'never'
  7. let g:ale_lint_on_insert_leave = 0
  8. let g:ale_lint_on_enter = 0
  9. " Set up Alexis King options
  10. call ale#Set('haskell_cabal_ghc_options', '-isrc -itest -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-code -v0')
  11. function! GetCommand(buffer) abort
  12. return 'cabal exec -- ghc '
  13. \ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
  14. \ . ' %t'
  15. endfunction
  16. call ale#linter#Define('haskell', {
  17. \ 'name': 'my_cabal_ghc',
  18. \ 'output_stream': 'stderr',
  19. \ 'executable': 'cabal',
  20. \ 'command': function('GetCommand'),
  21. \ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
  22. \})