blob: 85b3cfb2588be133e31cbd4ce37736aabe463225 [file] [log] [blame]
Bram Moolenaar6e7c7f32005-08-24 22:16:11 +00001" Vim syntax file
2" Language: eRuby
3" Maintainer: Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
4" Info: $Id$
5" URL: http://vim-ruby.sourceforge.net
6" Anon CVS: See above site
7" Licence: GPL (http://www.gnu.org)
8" Disclaimer:
9" This program is distributed in the hope that it will be useful,
10" but WITHOUT ANY WARRANTY; without even the implied warranty of
11" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12" GNU General Public License for more details.
13" ----------------------------------------------------------------------------
14
15" For version 5.x: Clear all syntax items
16" For version 6.x: Quit when a syntax file was already loaded
17if version < 600
18 syntax clear
19elseif exists("b:current_syntax")
20 finish
21endif
22
23if !exists("main_syntax")
24 let main_syntax = 'eruby'
25endif
26
27if version < 600
28 so <sfile>:p:h/html.vim
29 syn include @rubyTop <sfile>:p:h/ruby.vim
30else
31 runtime! syntax/html.vim
32 unlet b:current_syntax
33 syn include @rubyTop syntax/ruby.vim
34endif
35
36syn region erubyOneLiner matchgroup=erubyDelimiter start="^\s*\zs%" end="$" contains=@rubyTop,erubyDelimiter keepend
37syn region erubyBlock matchgroup=erubyDelimiter start="<%=\=" end="%>" contains=@rubyTop containedin=ALLBUT,erubyComment keepend
38syn region erubyComment matchgroup=erubyDelimiter start="<%#" end="%>" keepend
39
40" Define the default highlighting.
41" For version 5.7 and earlier: only when not done already
42" For version 5.8 and later: only when an item doesn't have highlighting yet
43if version >= 508 || !exists("did_eruby_syntax_inits")
44 if version < 508
45 let did_ruby_syntax_inits = 1
46 command -nargs=+ HiLink hi link <args>
47 else
48 command -nargs=+ HiLink hi def link <args>
49 endif
50
51 HiLink erubyDelimiter Delimiter
52 HiLink erubyComment Comment
53
54 delcommand HiLink
55endif
56let b:current_syntax = "eruby"
57
58if main_syntax == 'eruby'
59 unlet main_syntax
60endif
61
62" vim: sw=2 sts=2 ts=8 ff=unix nowrap: