Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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
share|improve this answer

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)

share|improve this answer
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 at 6:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.