On Nov 19, 6:25 pm, Niklas Lindström <[email protected]> wrote:
> Hi,
>
>
>
>
>
> On Thu, Nov 19, 2009 at 5:42 PM, björn <[email protected]> wrote:
>
> > 2009/11/19 saspijkerman:
> >> I often edit apache configuration files on the mac. Syntax
> >> Highlighting never 'auto-starts'. I found out why:
>
> >> In the following file are the filename-checks for syntax modus:
>
> >> /Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
>
> >> The lines for Apache Syntax mode are the following:
>
> >> " Apache style config file
> >> au BufNewFile,BufRead proftpd.conf*             call 
> >> s:StarSetf('apachestyle')
> >> " Apache config file
> >> au BufNewFile,BufRead .htaccess                  setf apache
> >> au BufNewFile,BufRead
> >> httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/
> >> apache2/*.conf* call s:StarSetf('apache')
> >> " More Apache files.
> >> au BufNewFile,BufRead /etc/apache2/conf.*/*,/etc/apache2/sites-*/*,/
> >> etc/apache2/mods-*/*            call s:StarSetf('apache')
>
> >> But on OSX Snow Leopard the default apache location is
>
> >> /private/etc/apache2/ in stead of /etc/apache2/
>
> >> So I replaced the line:
>
> >> au BufNewFile,BufRead
> >> httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/
> >> apache2/*.conf* call s:StarSetf('apache')
>
> >> with the following line:
>
> >> au BufNewFile,BufRead
> >> httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/
> >> apache2/*.conf*,/private/etc/apache2/*.conf* call s:StarSetf('apache')
>
> >> It works perfectly for now but I am afraid that this file will be
> >> replaced if there is an update for the MacVim App.
> >> How can I stop this from happening (and don't update doesn't count)?
>
> > Send a patch to vim_dev and ask Bram to include it in the mainline
> > (carefully explain why you made the patch).
>
> > In the meantime I guess you could just add the above autocommand (with
> > the "/private/etc/apache2/*.conf*" line only) to your ~/.vimrc file.
>
> .. or in a <~/.vim/filetype.vim> file (which is also read). See:
>
>     :help new-filetype
>
> Best regards,
> Niklas

Hi Niklas,

Thanks for that option. I didn't know that.

I created the <.vim/filetype.vim> file and added the following line:

$ cat .vim/filetype.vim
au BufNewFile,BufRead /private/etc/apache2/*.conf* setf apache

It works like a charm.

Stef
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to