views:

68

answers:

2

Hi,

I am trying to use Vim for web development but having trouble dealing with multiple languages in the same file. I may have php, html, javascript, and css all in the same file, but Vim will base the indentation, coloring, plugins, etc. just based on one of the languages.

Know of any plugins or vimrc hacks to fix this? Thanks.

+2  A: 

You can use the dotted 'filetype' syntax. For example, you can :set ft=html.php when you are working on a file containing both HTML and PHP code. I personally do this to activate snipMate's HTML and PHP snippets for the file being edited.

Yaser Sulaiman
+1  A: 

I am trying to use Vim for web development but having trouble dealing with multiple languages in the same file.

I have never tried that myself, but official VIM Wiki has the dedicate article for that: Different syntax highlighting within regions of a file.

Dummy00001