A Day in the Life

testbase.vim

testbase.vim

f:id:secondlife:20061117163415p:image

http://www.vim.org/scripts/script.php?script_id=1712

作ったよ。~/.vim/syntax/testbase.vim に上記 syntax を置いて、~/.vim/ftdetect/testbase.vim に↓書いておくと perl の *.t や ruby の *_test.rb なファイルで syntax highlight が動く、はず。

au BufNewFile,BufRead *_test.rb set filetype=ruby | unlet b:current_syntax | syn include @rubyTestBase syntax/testbase.vim | syn region rubyTestBase matchgroup=rubyData start="^__END__$" keepend end="\%$" contains=@rubyTestBase

au BufNewFile,BufRead *.t set filetype=perl | unlet b:current_syntax | syn include @perlTestBase syntax/testbase.vim | syn region perlTestBase matchgroup=perlData start="^__\(DATA\|END\)__$" keepend end="\%$" contains=@perlTestBase