blob: d34b37e8f6559d2f8400b19c33d6aa604fbc4a14 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim compiler file
Bram Moolenaar6b730e12005-09-16 21:47:57 +00002" 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
Bram Moolenaar6b730e12005-09-16 21:47:57 +00008" ----------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +00009"
10" Changelog:
Bram Moolenaard5cdbeb2005-10-10 20:59:28 +000011" 0.2: script saves and restores 'cpoptions' value to prevent problems with
12" line continuations
13" 0.1: initial release
Bram Moolenaar071d4272004-06-13 20:20:40 +000014"
15" Contributors:
16" Hugh Sasse <hgs@dmu.ac.uk>
Bram Moolenaar293ee4d2004-12-09 21:34:53 +000017" Doug Kearns <djkea2@gus.gscit.monash.edu.au>
Bram Moolenaar071d4272004-06-13 20:20:40 +000018"
19" Todo:
20" match error type %m
21"
22" Comments:
23" I know this file isn't perfect. If you have any questions, suggestions,
24" patches, etc., please don't hesitate to let me know.
25"
26" This is my first experience with 'errorformat' and compiler plugins and
27" I welcome any input from more experienced (or clearer-thinking)
28" individuals.
Bram Moolenaar6b730e12005-09-16 21:47:57 +000029" ----------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +000030
31if exists("current_compiler")
32 finish
33endif
34let current_compiler = "ruby"
35
36if exists(":CompilerSet") != 2 " older Vim always used :setlocal
37 command -nargs=* CompilerSet setlocal <args>
38endif
39
40let s:cpo_save = &cpo
41set cpo-=C
42
43" default settings runs script normally
44" add '-c' switch to run syntax check only:
45"
46" CompilerSet makeprg=ruby\ -wc\ $*
47"
48" or add '-c' at :make command line:
49"
50" :make -c %<CR>
51"
52CompilerSet makeprg=ruby\ -w\ $*
53
54CompilerSet errorformat=
55 \%+E%f:%l:\ parse\ error,
56 \%W%f:%l:\ warning:\ %m,
57 \%E%f:%l:in\ %*[^:]:\ %m,
58 \%E%f:%l:\ %m,
59 \%-C%\tfrom\ %f:%l:in\ %.%#,
60 \%-Z%\tfrom\ %f:%l,
61 \%-Z%p^,
62 \%-G%.%#
63
64let &cpo = s:cpo_save
65unlet s:cpo_save
66
Bram Moolenaar6b730e12005-09-16 21:47:57 +000067" vim: nowrap sw=2 sts=2 ts=8 ff=unix: