This is for all the vim users out there who edit mod_perl configurations. I wrote a patch for $VIMRUNTIME/syntax/apache.vim that will properly syntax highlight <Perl> blocks inside httpd.conf files. The changes required were actually very minimal:
--- /usr/share/vim/vim63/syntax/apache.vim 2005-03-20 13:35:11.00
+0000000 -0800
+++ apache.vim 2005-06-29 00:49:41.367120680 -0700
@@ -52,6 +52,7 @@
endif
syn keyword apacheOption Any All On Off Double EMail DNS Min Minimal
+OS Prod ProductOnly Full
syn keyword apacheOption emerg alert crit error warn notice info debu
+g
+syn match apacheOption "perl-script"
syn keyword apacheOption registry script inetd standalone
syn match apacheOptionOption "[+-]\?\<\(ExecCGI\|FollowSymLinks\|Incl
+udes\|IncludesNoExec\|Indexes\|MultiViews\|SymLinksIfOwnerMatch\)\>"
syn keyword apacheOption user group valid-user
@@ -191,6 +192,14 @@
syn keyword apacheDeclaration PerlCleanupHandler PerlChildInitHandler
+ PerlChildExitHandler
syn keyword apacheDeclaration PerlRestartHandler PerlDispatchHandler
syn keyword apacheDeclaration PerlFreshRestart PerlSendHeader
+syn include @Perl $VIMRUNTIME/syntax/perl.vim
+syn match apacheSection "<Perl>\|<\/Perl>" contained
+syn region apachePerlBlock
+ \ start="<Perl>"
+ \ end="<\/Perl>"
+ \ contains=@Perl, apacheSection
+ \ keepend
+
syn keyword apacheDeclaration php_value php_flag php_admin_value php_
+admin_flag
syn keyword apacheDeclaration AllowCONNECT NoProxy ProxyBlock ProxyDo
+main ProxyPass ProxyPassReverse ProxyReceiveBufferSize ProxyRemote Pr
+oxyRequests ProxyVia
if s:av < "002000000"
This patch was made against the apache.vim that came with vim 6.3, but I've also successfully run it against an apache.vim that came with vim 6.1. But just to be on the safe side, please back up your original apache.vim before you let patch do its magic.
Here's how I'd do it:
# go somewhere you have write access to
cd
# find out where apache.vim is
locate apache.vim
# of course, the path on your system to apache.vim may be different.
# substitute accordingly
cp /usr/share/vim/vim63/syntax/apache.vim .
# apply the patch
patch < apache.vim.diff
# and iff all went well.....
sudo cp apache.vim /usr/share/vim/vim63/syntax