hdevtools.vim 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. "============================================================================
  2. "File: hdevtools.vim
  3. "Description: Syntax checking plugin for syntastic.vim
  4. "Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>
  5. "License: This program is free software. It comes without any warranty,
  6. " to the extent permitted by applicable law. You can redistribute
  7. " it and/or modify it under the terms of the Do What The Fuck You
  8. " Want To Public License, Version 2, as published by Sam Hocevar.
  9. " See http://sam.zoy.org/wtfpl/COPYING for more details.
  10. "
  11. "============================================================================
  12. if exists('g:loaded_syntastic_haskell_hdevtools_checker')
  13. finish
  14. endif
  15. let g:loaded_syntastic_haskell_hdevtools_checker = 1
  16. let s:save_cpo = &cpo
  17. set cpo&vim
  18. function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
  19. if !exists('g:syntastic_haskell_hdevtools_args') && exists('g:hdevtools_options')
  20. call syntastic#log#oneTimeWarn('variable g:hdevtools_options is deprecated, ' .
  21. \ 'please use g:syntastic_haskell_hdevtools_args instead')
  22. let g:syntastic_haskell_hdevtools_args = g:hdevtools_options
  23. endif
  24. let makeprg = self.makeprgBuild({
  25. \ 'exe_after': 'check',
  26. \ 'fname': syntastic#util#shexpand('%:p') })
  27. let errorformat =
  28. \ '%-Z %#,'.
  29. \ '%W%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: Warning: %m,'.
  30. \ '%W%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: Warning:,'.
  31. \ '%E%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: %m,'.
  32. \ '%E%>%\m%f:%l:%v%\%%(-%\d%\+%\)%\=:,'.
  33. \ '%+C %#%m,'.
  34. \ '%W%>%\m%f:%l:%v%\%%(-%\d%\+%\)%\=:,'.
  35. \ '%+C %#%tarning: %m,'
  36. return SyntasticMake({
  37. \ 'makeprg': makeprg,
  38. \ 'errorformat': errorformat,
  39. \ 'defaults': {'vcol': 1},
  40. \ 'postprocess': ['compressWhitespace'] })
  41. endfunction
  42. call g:SyntasticRegistry.CreateAndRegisterChecker({
  43. \ 'filetype': 'haskell',
  44. \ 'name': 'hdevtools'})
  45. let &cpo = s:save_cpo
  46. unlet s:save_cpo
  47. " vim: set sw=4 sts=4 et fdm=marker: