macruby.vim 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. "============================================================================
  2. "File: macruby.vim
  3. "Description: Syntax checking plugin for syntastic.vim
  4. "License: This program is free software. It comes without any warranty,
  5. " to the extent permitted by applicable law. You can redistribute
  6. " it and/or modify it under the terms of the Do What The Fuck You
  7. " Want To Public License, Version 2, as published by Sam Hocevar.
  8. " See http://sam.zoy.org/wtfpl/COPYING for more details.
  9. "
  10. "============================================================================
  11. if exists('g:loaded_syntastic_ruby_macruby_checker')
  12. finish
  13. endif
  14. let g:loaded_syntastic_ruby_macruby_checker = 1
  15. let s:save_cpo = &cpo
  16. set cpo&vim
  17. function! SyntaxCheckers_ruby_macruby_GetLocList() dict
  18. let makeprg = self.makeprgBuild({
  19. \ 'args': '-W1',
  20. \ 'args_after': '-c' })
  21. let errorformat =
  22. \ '%-GSyntax OK,'.
  23. \ '%E%f:%l: syntax error\, %m,'.
  24. \ '%Z%p^,'.
  25. \ '%W%f:%l: warning: %m,'.
  26. \ '%Z%p^,'.
  27. \ '%W%f:%l: %m,'.
  28. \ '%-C%.%#'
  29. let env = { 'RUBYOPT': '' }
  30. return SyntasticMake({
  31. \ 'makeprg': makeprg,
  32. \ 'errorformat': errorformat,
  33. \ 'env': env })
  34. endfunction
  35. call g:SyntasticRegistry.CreateAndRegisterChecker({
  36. \ 'filetype': 'ruby',
  37. \ 'name': 'macruby'})
  38. let &cpo = s:save_cpo
  39. unlet s:save_cpo
  40. " vim: set sw=4 sts=4 et fdm=marker: