Super User is a question and answer site for computer enthusiasts and power users. 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

Is it possible to use HTML snippets with Vim's snipMate plugin in a PHP file without changing the filetype? I'd like to be able to use the HTML snippets in my PHP files because a lot of times I am working in views where I need to use a lot of HTML and PHP. I would like to do it without changing the filetype because that throws off syntax highlighting.

share|improve this question
up vote 1 down vote accepted

I guess I should have checked SO first... Here is an answer to my question:

You just need to put this in your .vimrc file:

au BufRead *.php set ft=php.html
au BufNewFile *.php set ft=php.html

I think this belongs on SuperUser so I will leave the answer here for anyone else who comes across this.

share|improve this answer

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.