.nvimrc 779 B

1234567891011121314151617181920212223
  1. " Enable hlint and GHC via Cabal
  2. let g:ale_linters = {'haskell': ['hlint', 'cabal_new_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_enter = 'never'
  8. " Set up Alexis King options
  9. " Have to do it this way because ALE is special
  10. call ale#linter#Define('haskell', {
  11. \ 'name': 'cabal_new_ghc',
  12. \ 'aliases': ['cabal-new-ghc'],
  13. \ 'output_stream': 'stderr',
  14. \ 'executable': 'cabal',
  15. \ 'command': 'cabal new-exec -- ghc -isrc -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-code -v0 %t',
  16. \ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
  17. \})
  18. augroup fmt
  19. autocmd!
  20. autocmd BufWritePre *.hs undojoin | Neoformat hindent
  21. augroup END