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.

link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

I guess I should have checked SO first... Here is an answer to my question: http://stackoverflow.com/questions/3008575/vim-activiting-html-snippets-on-php-files

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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