Hi Rich & Sune,
Umm, so what's wrong with the HTML-PHP syntax highlighting that ships with TM? Using this syntax, anything outside PHP delimiters is considered HTML and highlighted accordingly (albeit in grey), which is what you want, right?
Perhaps I didn't make myself clear enough, so let's use some images to save me a 1000 words. ; )
in BBEdit 8.0
in skEdit 3.5b5 with PHP syntax highlighting
in TextMate with 'HTML (Basic)' syntax highlighting
in TextMate with 'HTML (PHP)' syntax highlighting
in TextMate with 'PHP' syntax highlighting: (HTML treated as PHP code)
What I would like is something along the lines of BBEdit & skEdit's and their dual highlighting capabilities. In other words, when we are in a .php file and exit php with ?> and then start having HTML code in there, then the HTML code highlighting should work just as IF we were using a .html file. And vice versa.
As it is right now, I have a choice of highlighting for HTML or for PHP, BUT NOT both at the same time.
All my settings and the results thereof:
My HTML syntax file is in a bundle called mxHTML and the syntax file is named mxHTML.plist and it is a copy of this file:
BASIC HTML DICTIONARY FOR TEXTMATE ================================== Version 1.0 (Sune Foldager, Justin French, Allan Odgaard)
with the following changes (apart from colour settings):
name = "mxHTML";
/* * embedded languages -- [SNIP] */ { name = "Embedded PHP"; begin = "<\?(php|=)?"; end = "\?>"; patterns = ( { include = "mxPHP"; } ); },
My PHP syntax file is in a bundle called mxPHP and the syntax file is named mxPHP.plist and its a copy of Jason Spahr's Smarty PHP bundle.
with the following changes:
name = "mxPHP";
{ name = "Embedded HTML"; begin = "\?>"; end = "<\?(php|=)?"; patterns = ( { include = "mxHTML"; } ); },
The same code block rendered with my syntax files:
with mxHTML syntax highlighting:
with mxPHP syntax highlighting:
Apologies for the length and size of this email, but I hope this will have clarified my position and aid in solving this problem.
IF I am asking for the impossible, then Allan & gang has some more work to do, else I am doing something wrong, and someone smarter than me will hopefully point me in the right direction. : )
Kind regards,
Mats