From: Tobias DiPasquale Date: 2002-03-08T08:57:18+09:00 Subject: RHTML syntax highlighting with VIM Hi all, Here's a simple little .vim script to handle syntax high- lighting of .rhtml files, used with eRuby and mod_ruby. I use it myself, and I figured someone else may want it too. Enjoy! % cat rhtml.vim " HTML with embedded Ruby " Language: HTML + Ruby " Maintainer: Tobias DiPasquale " Last Modified: 2002 Mar 07 " Location: http://cbcg.net/rhtml.vim " for portability if version < 600 syntax clear elseif exists("b:current_syntax") finish endif " load all of the HTML info source $VIMRUNTIME/syntax/html.vim unlet b:current_syntax " load all of the ruby info into @Ruby syntax include @Ruby $VIMRUNTIME/syntax/ruby.vim syntax region rhtmlRuby \ start=/<%/ \ end=/%>/ \ contains=@Ruby, rhtmlRuby let b:current_syntax = "rhtml" % You find out where to put this by entering vim, and typing :echo $VIMRUNTIME in command mode. Put the file in the $VIMRUNTIME/syntax directory, and edit $VIMRUNTIME/filetype.vim, adding the following stuff: " RHTML (server-parsed HTML w/embedded Ruby) au BufNewFile,BufRead *.rhtml setf rhtml That's it. Now you can get some pretty highlighting when editing .rhtml files in VIM. I am working on a syntax highlighting scheme for RHTML files in SciTE next, and when I do that, I will post it here, as well. Take care! ================= Tobias DiPasquale Linux Systems Engineer ePrivacy Group, Inc. =================