Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

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.

share|improve this answer
add comment

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.