Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

2 Answers 2

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
which exactly i already did –  ajreal Nov 18 '12 at 16:06

Your Answer


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.