Mercurial > vim
comparison runtime/syntax/eruby.vim @ 1668:0b796e045c42 v7.2b.000
updated for version 7.2b-000
author | vimboss |
---|---|
date | Sun, 13 Jul 2008 17:41:49 +0000 |
parents | 82b5078be2dd |
children | 7bc41231fbc7 |
comparison
equal
deleted
inserted
replaced
1667:131dbd3d2a4b | 1668:0b796e045c42 |
---|---|
20 | 20 |
21 if !exists("b:eruby_subtype") && main_syntax == 'eruby' | 21 if !exists("b:eruby_subtype") && main_syntax == 'eruby' |
22 let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") | 22 let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") |
23 let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') | 23 let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') |
24 if b:eruby_subtype == '' | 24 if b:eruby_subtype == '' |
25 let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\)\+$','',''),'\.\zs\w\+$') | 25 let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\)\+$','',''),'\.\zs\w\+$') |
26 endif | 26 endif |
27 if b:eruby_subtype == 'rhtml' | 27 if b:eruby_subtype == 'rhtml' |
28 let b:eruby_subtype = 'html' | 28 let b:eruby_subtype = 'html' |
29 elseif b:eruby_subtype == 'rb' | 29 elseif b:eruby_subtype == 'rb' |
30 let b:eruby_subtype = 'ruby' | 30 let b:eruby_subtype = 'ruby' |
53 endif | 53 endif |
54 syn include @rubyTop syntax/ruby.vim | 54 syn include @rubyTop syntax/ruby.vim |
55 | 55 |
56 syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment | 56 syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment |
57 | 57 |
58 exe 'syn region erubyOneLiner matchgroup=erubyDelimiter start="^%\{1,'.b:eruby_nest_level.'\}%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erbRegions keepend oneline' | 58 exe 'syn region erubyOneLiner matchgroup=erubyDelimiter start="^%\{1,'.b:eruby_nest_level.'\}%\@!" end="$" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend oneline' |
59 exe 'syn region erubyBlock matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}%\@!-\=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erbRegions' | 59 exe 'syn region erubyBlock matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}%\@!-\=" end="-\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend' |
60 exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=" end="-\=%>" contains=@rubyTop containedin=ALLBUT,@erbRegions' | 60 exe 'syn region erubyExpression matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}=" end="-\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=@rubyTop containedin=ALLBUT,@erubyRegions keepend' |
61 exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}#" end="-\=%>" contains=rubyTodo,@Spell containedin=ALLBUT,@erbRegions keepend' | 61 exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:eruby_nest_level.'\}#" end="-\=%\@<!%\{1,'.b:eruby_nest_level.'\}>" contains=rubyTodo,@Spell containedin=ALLBUT,@erubyRegions keepend' |
62 | 62 |
63 " Define the default highlighting. | 63 " Define the default highlighting. |
64 " For version 5.7 and earlier: only when not done already | |
65 " For version 5.8 and later: only when an item doesn't have highlighting yet | |
66 if version >= 508 || !exists("did_eruby_syntax_inits") | |
67 if version < 508 | |
68 let did_ruby_syntax_inits = 1 | |
69 command -nargs=+ HiLink hi link <args> | |
70 else | |
71 command -nargs=+ HiLink hi def link <args> | |
72 endif | |
73 | 64 |
74 HiLink erubyDelimiter Delimiter | 65 hi def link erubyDelimiter Delimiter |
75 HiLink erubyComment Comment | 66 hi def link erubyComment Comment |
76 | 67 |
77 delcommand HiLink | |
78 endif | |
79 let b:current_syntax = 'eruby' | 68 let b:current_syntax = 'eruby' |
80 | 69 |
81 if main_syntax == 'eruby' | 70 if main_syntax == 'eruby' |
82 unlet main_syntax | 71 unlet main_syntax |
83 endif | 72 endif |
84 | 73 |
85 " vim: nowrap sw=2 sts=2 ts=8 : | 74 " vim: nowrap sw=2 sts=2 ts=8: |