2

I notice the syntax file for PHP for vim is quite out-dated.
Does anyone know where is these syntax file located in Mac so I can do the upgrade?

3

Solved myself,
here are the steps :-

  1. locate vim | grep php
  2. turn up is this file /usr/share/vim/vim73/syntax/php.vim
  3. sudo mv /usr/share/vim/vim73/syntax/php.vim /usr/share/vim/vim73/autoload/phpcomplete.vim.orig as backup
  4. download latest php vim file from http://www.vim.org
  5. untar the tarball
  6. copy the php.vim to /usr/share/vim/vim73/syntax/php.vim
-1

I think the proper solution is to install the updated syntax file locally, in your ~/.vim/syntax directory. From your answer, you have installed the syntax file in /usr/share/vim, which is system class directory. This is not recommended since this can be erased on system or application update, and you don't know what your modification might conflict with. Instead, you should put all your vim configuration files under your home directory in ~/.vim.

(Sorry if it isn't a proper answer to your problem, but it seems I can't add comment to already posted answers)

2
  • 1
    which exactly i already did – ajreal Nov 18 '12 at 16:06
  • It seems to me what you did is quite a different approach: directly modifying the system version of the file in /usr/share/vim. Please reread my answer to understand why it is not the proper way to override the default syntax file. If you look a possibly up to date syntax file, I suggest you take a look at StanAngeloff's php syntax plugin (or better, if you use many languages: the vim-polyglot plugin). – komuta Mar 29 '16 at 6:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .