verapp.vim 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. "============================================================================
  2. "File: verapp.vim
  3. "Description: Syntax checking plugin for syntastic.vim
  4. "Maintainer: Lucas Verney <phyks@phyks.me>
  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. " Tested with Vera++ 1.3.0
  12. "============================================================================
  13. if exists('g:loaded_syntastic_cpp_verapp_checker')
  14. finish
  15. endif
  16. let g:loaded_syntastic_cpp_verapp_checker = 1
  17. if !exists('g:syntastic_verapp_config_file')
  18. let g:syntastic_verapp_config_file = '.syntastic_verapp_config'
  19. endif
  20. let s:save_cpo = &cpo
  21. set cpo&vim
  22. function! SyntaxCheckers_cpp_verapp_GetLocList() dict
  23. let makeprg = self.makeprgBuild({
  24. \ 'args': syntastic#c#ReadConfig(g:syntastic_verapp_config_file),
  25. \ 'args_after': '--show-rule --no-duplicate -S -c -' })
  26. let errorformat = '%f:%t:%l:%c:%m'
  27. return SyntasticMake({
  28. \ 'makeprg': makeprg,
  29. \ 'errorformat': errorformat,
  30. \ 'preprocess': 'checkstyle',
  31. \ 'subtype': 'Style' })
  32. endfunction
  33. call g:SyntasticRegistry.CreateAndRegisterChecker({
  34. \ 'filetype': 'cpp',
  35. \ 'name': 'verapp',
  36. \ 'exec': 'vera++'})
  37. let &cpo = s:save_cpo
  38. unlet s:save_cpo
  39. " vim: set sw=4 sts=4 et fdm=marker: