diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-03-26 08:26:59 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-03-26 08:26:59 +0200 |
commit | 3a80316ff8ff7a21b1f57e2a923b281ac1b4b146 (patch) | |
tree | f6fe1f701e1b2c984bcce7fb45f082903e1cb51b /syntax/eruby.vim | |
parent | c17fc39b2c5139028f8e94f03d9bce4d7748aa52 (diff) | |
download | vim-3a80316ff8ff7a21b1f57e2a923b281ac1b4b146.zip vim-3a80316ff8ff7a21b1f57e2a923b281ac1b4b146.tar.gz |
add syntax
Diffstat (limited to 'syntax/eruby.vim')
-rw-r--r-- | syntax/eruby.vim | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/syntax/eruby.vim b/syntax/eruby.vim new file mode 100644 index 0000000..2888e54 --- /dev/null +++ b/syntax/eruby.vim @@ -0,0 +1,42 @@ +" Vim syntax file +" Language: eruby +" Maintainer: Michael Brailsford <brailsmt@yahoo.com> +" Installation: +" To automatilcally load this file when a .rhtml file is opened, add the +" following lines to ~/.vim/filetype.vim: +" +" augroup filetypedetect +" au! BufRead,BufNewFile *.rhtml setfiletype eruby +" augroup END +" +" You will have to restart vim for this to take effect. In any case it +" is a good idea to read ":he new-filetype" so that you know what is going +" on, and why the above lines work. + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +"Source the html syntax file +ru! syntax/html.vim +"Set the filetype to html to load the html ftplugins +set ft=html +unlet b:current_syntax + +"Put the ruby syntax file in @rubyTop +syn include @rubyTop syntax/ruby.vim + +syn region erubyBlock matchgroup=erubyRubyDelim start=#<%=\?# end=#%># keepend containedin=ALL contains=@rubyTop,erubyEnd +syn region erubyComment start=+<%#+ end=#%># keepend +syn match erubyEnd #\<end\># + +" hi erubyBlock ctermbg=Gray +hi link erubyDelim delimiter +hi link erubyComment comment +hi link erubyEnd rubyControl + +iab %= <%= %><LEFT><LEFT><LEFT> +iab %% <% -%><LEFT><LEFT><LEFT><LEFT> +" vim: set ts=4 sw=4: |