I'm working on a PHP project where all files are given the extension '.shtml'. Unfortunately Vim doesn't know to highlight PHP in these files. Is there as way to force Vim to highlight these files as PHP instead of shtml?
+5
A:
You can add this to your .vimrc
au BufNewFile,BufRead *.shtml set filetype=php
also... the quick-fix when you're already in vim:
:set filetype=php
EMiller
2009-12-21 18:32:51
A few secs faster :-))
ldigas
2009-12-21 18:34:35
+3
A:
You can also add something like
<?php /* vim:set ft=php: */
in the beginning of your file. That would make it more or less independent of the local vim settings.
Michael Krelin - hacker
2009-12-21 18:37:01