Multiple language syntax and processing

Hello,

In a few different apps of mine I have files that mix languages together. The most common example are PHP views that contain mostly javascript with a few PHP directives. If these files are opened as PHP files than I don't benefit from any of the formatting help / syntax highlighting granted by a Javascript identified file which makes it a big pain in the ass to develop. Conversely, if I add a special filetype to be recognized as Javascript the php tags get royally messed up which also makes it difficult to develop with. The biggest problem is typically during pasting when the reformatter has a hay day or when the highlighter thinks I'm an idiot and messed up my string closures.

Any tips or references to plugins would be VERY helpful.

Thanks

3 comments

Hi there,

Please check this answer: http://stackoverflow.com/a/18114575/783119 -- you just need to use "JavaScript" instead of "XML".

0

*bow*

Your google-fu is strong. I am but a grasshopper.

Seriously, thanks a million for this. I've been looking for that Settings | Template Data Languages panel for a long time. I don't suppose there's a way to automatically apply that based on file extension (similar to the File Types window) across my project without individually selecting the files?

0
Your google-fu is strong.

Easy -- it's my own (recent) answer.

I don't suppose there's a way to automatically apply that based on file extension (similar to the File Types window) across my project without individually selecting the files?

No.

0

Please sign in to leave a comment.