PHP/HTML enhancements for TextMate

My first little bit of TextMate language grammar hacking: PHP.tmbundle 2.0.1, which has two small enhancements over the stock 2.0:

  • HTML code embedded inside <<<HTMLHTML; heredoc delimiters will be colorized as HTML
  • Code-folding is enabled for those blocks

Enjoy! Feedback is welcome. Thanks to Textmate author Allan Odgaard for helpful answers to my newbie questions on the TextMate mailing list.


ritesh commented on Thu Nov 10 13:03:27 2005:

this is good.


Bonatoc commented :

Thanks a lot !

I found TextMate a little limited when it comes to colorize code, I mean it does not seem as customizable as… Dreamweaver (doh !). Is there a way to push further your hack and customize the coloring of, let’s say <table> tags ?


Paul commented :

TextMate’s bundle features can be pushed very far (and do a lot more than syntax coloring). For learning more on this I recommend the manual or the book.

Keep in mind that the colorizing has a semantic component, i.e. if you wanted “table” tags to look different you’d have to alter TextMate’s HTML language grammar (via the Bundle Editor) to treat them as something other than a regular tag. And then you’d have your own custom grammar that wouldn’t integrate any future updates. Probably not worth the effort.

Share: