Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

You must log in to answer this question.

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