Syntax highlighting is definitely your friend when you're coding, and while I love TextMate, it's support for some languages is still a bit lacking.
For reference, you can always get my current customized theme(s) here. You can browse more themes at the Textmate Wiki.
Fortunately, it's rather easy to customize the language packs. Here's what I did to expand TextMate's support for some common Python keywords:
- In TextMate, select Bundles » Bundle Editor » Edit Languages
- Scroll down, tick the arrow next to Python, and then select Python again (see bottom picture)
- Look for the following line:
{ comment = "keywords that haven't fit into other groups (yet)."; match = '\b(as|assert|del|exec|print)\b'; captures = { 1 = { name = 'keyword.other.python'; }; }; },
- After print you can add whatever you want, separated by the "pipe" sign - I added: |str|int|set|repr|float|ord|chr - you can add as many as you like, and I'll likely add more down the road. Just make sure you keep the closing parenthesis in there.
- Click the "Test" button at the bottom to confirm.
That's it - now when you use one of these functions, you'll get some syntax coloring.
Update:
To get the 'global' keyword recognized, add the following to your theme:

I've taken a similar approach with the "support" scope selector to get syntax highlighting on __name__ type objects.
