perl.vim 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. " Vim compiler file
  2. " Compiler: Perl syntax checks (perl -Wc)
  3. " Maintainer: vim-perl <vim-perl@googlegroups.com>
  4. " Author: Christian J. Robinson <heptite@gmail.com>
  5. " Homepage: https://github.com/vim-perl/vim-perl
  6. " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
  7. " License: Vim License (see :help license)
  8. " Last Change: 2021 Nov 2
  9. " 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
  10. if exists("current_compiler")
  11. finish
  12. endif
  13. let current_compiler = "perl"
  14. let s:savecpo = &cpo
  15. set cpo&vim
  16. if get(g:, 'perl_compiler_force_warnings', 1)
  17. let s:warnopt = 'W'
  18. else
  19. let s:warnopt = 'w'
  20. endif
  21. if getline(1) =~# '-[^ ]*T'
  22. let s:taintopt = 'T'
  23. else
  24. let s:taintopt = ''
  25. endif
  26. exe 'CompilerSet makeprg=perl\ -' . s:warnopt . s:taintopt . 'c\ %:S'
  27. CompilerSet errorformat=
  28. \%-G%.%#had\ compilation\ errors.,
  29. \%-G%.%#syntax\ OK,
  30. \%m\ at\ %f\ line\ %l.,
  31. \%+A%.%#\ at\ %f\ line\ %l\\,%.%#,
  32. \%+C%.%#
  33. " Explanation:
  34. " %-G%.%#had\ compilation\ errors., - Ignore the obvious.
  35. " %-G%.%#syntax\ OK, - Don't include the 'a-okay' message.
  36. " %m\ at\ %f\ line\ %l., - Most errors...
  37. " %+A%.%#\ at\ %f\ line\ %l\\,%.%#, - As above, including ', near ...'
  38. " %+C%.%# - ... Which can be multi-line.
  39. let &cpo = s:savecpo
  40. unlet s:savecpo