Take the 2-minute tour ×  When I work on PHP files, there are
many chances that I will embed some HTML into it. The problem is
when I edit a file named foo.php Vim automatically sets its
filetype to php and the snippets for html doensn't work in it.
Well I can quickly set the filetype to html (:set ft=html) but
changing between two seems hard to me and I lose the
highlightation of php file if I set it to html, its amazing that
highlightation for html works if the filetype is php.  I'm using
snipMate as my snippet manager. How can I achieve which I want.
share|improve this question  2 Answers 2  up vote 3 down vote
accepted  You didn't tell us the snippet plugin you're using.
For the original snipMate plugin, create a file
~/.vim/ftplugin/php_snipMate.vim with the following contents:
silent call ExtractSnipsFile(g:snippets_dir . 'html.snippets',
&l:filetype)  Because of the script name and location, it will
be automatically sourced for all PHP files and import the html
snippets in addition to all existing P