blob: ff3b3c702c0881a44e23e159cf8322fc1118e6bf [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim compiler file
Bram Moolenaarc6249bb2006-04-15 20:25:09 +00002" Language: Ruby
3" Function: Syntax check and/or error reporting
4" Maintainer: Tim Hammerquist <timh at rubyforge.org>
Bram Moolenaar5c736222010-01-06 20:54:52 +01005" Info: $Id: ruby.vim,v 1.13 2008/06/29 04:18:43 tpope Exp $
Bram Moolenaarc6249bb2006-04-15 20:25:09 +00006" URL: http://vim-ruby.rubyforge.org
7" Anon CVS: See above site
8" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
Bram Moolenaar6b730e12005-09-16 21:47:57 +00009" ----------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +000010"
11" Changelog:
Bram Moolenaard5cdbeb2005-10-10 20:59:28 +000012" 0.2: script saves and restores 'cpoptions' value to prevent problems with
13" line continuations
14" 0.1: initial release
Bram Moolenaar071d4272004-06-13 20:20:40 +000015"
16" Contributors:
17" Hugh Sasse <hgs@dmu.ac.uk>
Bram Moolenaar293ee4d2004-12-09 21:34:53 +000018" Doug Kearns <djkea2@gus.gscit.monash.edu.au>
Bram Moolenaar071d4272004-06-13 20:20:40 +000019"
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.
Bram Moolenaar6b730e12005-09-16 21:47:57 +000030" ----------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +000031
32if exists("current_compiler")
33 finish
34endif
35let current_compiler = "ruby"
36
37if exists(":CompilerSet") != 2 " older Vim always used :setlocal
38 command -nargs=* CompilerSet setlocal <args>
39endif
40
41let s:cpo_save = &cpo
42set 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"
53CompilerSet makeprg=ruby\ -w\ $*
54
55CompilerSet 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
65let &cpo = s:cpo_save
66unlet s:cpo_save
67
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000068" vim: nowrap sw=2 sts=2 ts=8: