On 10/10/08 03:46, Alexis Wilke wrote:
> Hi guys,
>
> I'm developing on Drupal now a days and find it annoying that gvim cannot
> detect that the .module are PHP files. So I added a few lines of code to
> my filetype.vim to paliate. I would imagine some other vi lovers will run
> in this one too. We could also support the .install files I guess. Also
> that I do not have much of a problem with.
>
> Thank you.
> Alexis Wilke
Don't ever modify anything under $VIMRUNTIME, including
$VIMRUNTIME/filetype.vim, because any update may (and sooner or later
will) silently undo your changes. This may happen next week, or it may
happen next year, and in the latter case you will probably have
forgotten by then which changes you made in the distribution.
The right place for those changes is in $VIM/vimfiles/filetype.vim if
you want them to apply to all users on your system, or in
$HOME/.vim/fileype.vim (on Unix) or $HOME/vimfiles/filetype.vim (on
Windows) if you want them to be used only by yourself.
This is how you would set up this file (asssuming it doesn't exist yet):
augroup filetypedetect
au BufNewFile,BufRead *.hw,*.module,*.pkg
\ if getline(1) =~ '<\?php' |
\ setf php |
\ endif
augroup END
And if the desired directories don't exist yet, well, create them. If
you don't know where $HOME and $VIM are, use
:echo $VIM
:echo $HOME
inside Vim.
Best regards,
Tony.
--
Paradise is exactly like where you are right now ... only much, much
better.
-- Laurie Anderson
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---