home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / runtime / dos / compiler / ruby.vim < prev    next >
Encoding:
Text File  |  2010-08-14  |  1.8 KB  |  69 lines

  1. " Vim compiler file
  2. " Language:        Ruby
  3. " Function:        Syntax check and/or error reporting
  4. " Maintainer:        Tim Hammerquist <timh at rubyforge.org>
  5. " Last Change:        2008 Aug 1
  6. " URL:            http://vim-ruby.rubyforge.org
  7. " Anon CVS:        See above site
  8. " Release Coordinator:    Doug Kearns <dougkearns@gmail.com>
  9. " ----------------------------------------------------------------------------
  10. "
  11. " Changelog:
  12. " 0.2:    script saves and restores 'cpoptions' value to prevent problems with
  13. "    line continuations
  14. " 0.1:    initial release
  15. "
  16. " Contributors:
  17. "   Hugh Sasse <hgs@dmu.ac.uk>
  18. "   Doug Kearns <djkea2@gus.gscit.monash.edu.au>
  19. "
  20. " Todo:
  21. "   match error type %m
  22. "
  23. " Comments:
  24. "   I know this file isn't perfect.  If you have any questions, suggestions,
  25. "   patches, etc., please don't hesitate to let me know.
  26. "
  27. "   This is my first experience with 'errorformat' and compiler plugins and
  28. "   I welcome any input from more experienced (or clearer-thinking)
  29. "   individuals.
  30. " ----------------------------------------------------------------------------
  31.  
  32. if exists("current_compiler")
  33.   finish
  34. endif
  35. let current_compiler = "ruby"
  36.  
  37. if exists(":CompilerSet") != 2        " older Vim always used :setlocal
  38.   command -nargs=* CompilerSet setlocal <args>
  39. endif
  40.  
  41. let s:cpo_save = &cpo
  42. set cpo-=C
  43.  
  44. " default settings runs script normally
  45. " add '-c' switch to run syntax check only:
  46. "
  47. "   CompilerSet makeprg=ruby\ -wc\ $*
  48. "
  49. " or add '-c' at :make command line:
  50. "
  51. "   :make -c %<CR>
  52. "
  53. CompilerSet makeprg=ruby\ -w\ $*
  54.  
  55. CompilerSet errorformat=
  56.     \%+E%f:%l:\ parse\ error,
  57.     \%W%f:%l:\ warning:\ %m,
  58.     \%E%f:%l:in\ %*[^:]:\ %m,
  59.     \%E%f:%l:\ %m,
  60.     \%-C%\tfrom\ %f:%l:in\ %.%#,
  61.     \%-Z%\tfrom\ %f:%l,
  62.     \%-Z%p^,
  63.     \%-G%.%#
  64.  
  65. let &cpo = s:cpo_save
  66. unlet s:cpo_save
  67.  
  68. " vim: nowrap sw=2 sts=2 ts=8:
  69.