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