1" Vim compiler file 2" Language: Ruby 3" Function: Syntax check and/or error reporting 4" Maintainer: Tim Hammerquist <timh at rubyforge.org> 5" Info: $Id$ 6" URL: http://vim-ruby.rubyforge.org 7" Anon CVS: See above site 8" Licence: GPL (http://www.gnu.org) 9" Disclaimer: 10" This program is distributed in the hope that it will be useful, 11" but WITHOUT ANY WARRANTY; without even the implied warranty of 12" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13" GNU General Public License for more details. 14" ---------------------------------------------------------------------------- 15" 16" Changelog: 17" 0.2: script saves and restores 'cpoptions' value to prevent problems with 18" line continuations 19" 0.1: initial release 20" 21" Contributors: 22" Hugh Sasse <[email protected]> 23" Doug Kearns <[email protected]> 24" 25" Todo: 26" match error type %m 27" 28" Comments: 29" I know this file isn't perfect. If you have any questions, suggestions, 30" patches, etc., please don't hesitate to let me know. 31" 32" This is my first experience with 'errorformat' and compiler plugins and 33" I welcome any input from more experienced (or clearer-thinking) 34" individuals. 35" ---------------------------------------------------------------------------- 36 37if exists("current_compiler") 38 finish 39endif 40let current_compiler = "ruby" 41 42if exists(":CompilerSet") != 2 " older Vim always used :setlocal 43 command -nargs=* CompilerSet setlocal <args> 44endif 45 46let s:cpo_save = &cpo 47set cpo-=C 48 49" default settings runs script normally 50" add '-c' switch to run syntax check only: 51" 52" CompilerSet makeprg=ruby\ -wc\ $* 53" 54" or add '-c' at :make command line: 55" 56" :make -c %<CR> 57" 58CompilerSet makeprg=ruby\ -w\ $* 59 60CompilerSet errorformat= 61 \%+E%f:%l:\ parse\ error, 62 \%W%f:%l:\ warning:\ %m, 63 \%E%f:%l:in\ %*[^:]:\ %m, 64 \%E%f:%l:\ %m, 65 \%-C%\tfrom\ %f:%l:in\ %.%#, 66 \%-Z%\tfrom\ %f:%l, 67 \%-Z%p^, 68 \%-G%.%# 69 70let &cpo = s:cpo_save 71unlet s:cpo_save 72 73" vim: nowrap sw=2 sts=2 ts=8 ff=unix: 74