497
|
1 " Vim syntax file
|
831
|
2 " Language: eRuby
|
|
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
4 " Info: $Id$
|
|
5 " URL: http://vim-ruby.rubyforge.org
|
|
6 " Anon CVS: See above site
|
|
7 " Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
497
|
8
|
|
9 " For version 5.x: Clear all syntax items
|
|
10 " For version 6.x: Quit when a syntax file was already loaded
|
|
11 if version < 600
|
|
12 syntax clear
|
|
13 elseif exists("b:current_syntax")
|
|
14 finish
|
|
15 endif
|
|
16
|
|
17 if !exists("main_syntax")
|
|
18 let main_syntax = 'eruby'
|
|
19 endif
|
|
20
|
|
21 if version < 600
|
|
22 so <sfile>:p:h/html.vim
|
|
23 syn include @rubyTop <sfile>:p:h/ruby.vim
|
|
24 else
|
|
25 runtime! syntax/html.vim
|
|
26 unlet b:current_syntax
|
|
27 syn include @rubyTop syntax/ruby.vim
|
|
28 endif
|
|
29
|
530
|
30 syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment
|
|
31
|
1121
|
32 syn region erubyOneLiner matchgroup=erubyDelimiter start="^%%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend oneline
|
|
33 syn region erubyBlock matchgroup=erubyDelimiter start="<%%\@!-\=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erubyRegions
|
|
34 syn region erubyExpression matchgroup=erubyDelimiter start="<%=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erubyRegions
|
|
35 syn region erubyComment matchgroup=erubyDelimiter start="<%#" end="-\=%>" contains=rubyTodo,@Spell containedin=ALLBUT,@erubyRegions keepend
|
497
|
36
|
|
37 " Define the default highlighting.
|
|
38 " For version 5.7 and earlier: only when not done already
|
|
39 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
40 if version >= 508 || !exists("did_eruby_syntax_inits")
|
|
41 if version < 508
|
|
42 let did_ruby_syntax_inits = 1
|
|
43 command -nargs=+ HiLink hi link <args>
|
|
44 else
|
|
45 command -nargs=+ HiLink hi def link <args>
|
|
46 endif
|
|
47
|
|
48 HiLink erubyDelimiter Delimiter
|
|
49 HiLink erubyComment Comment
|
|
50
|
|
51 delcommand HiLink
|
|
52 endif
|
|
53 let b:current_syntax = "eruby"
|
|
54
|
|
55 if main_syntax == 'eruby'
|
|
56 unlet main_syntax
|
|
57 endif
|
|
58
|
530
|
59 " vim: nowrap sw=2 sts=2 ts=8 ff=unix:
|