Saturday, October 27, 2007

Edit in TextMate Option

A cool trick that appears in the excellent TextMate book from the Prags is the "Edit in Textmate" menu item. If you go to the TextMate sub-menu under "Bundles", you'll see an option to Install "Edit in TextMate". The ensuing popup walks you through the steps to do this. Now, in some applications (like Safari), when you go to a textbox on a web page, you can issue the added Edit | Edit in TextMate command from Safari. TextMate will pop up, and now you have the full editing power of TextMate for your entry. When you hit "save", you'll see the browser's textbox update.

What's even better is that you can make it understand custom syntax. The popup that walks you through installing this option tells you how. So, for example, I'm typing this entry in TextMate, using HTML mode, but it is being automagically saved in the entry field on Blogger. By creating a simple ".plist" file in a special place, you can create custom bundle associations based on the URL you typed in the browser. Or, if that's too much work, the first time you launch a file from a particular web page's textbox, manually set the mode and TextMate will remember it for you. This is the way I type stuff for web pages anymore.

1 comment:

Christophe said...

For non OS X users (although even them can use it), Firefox has the "It's all text" extension that seemingly does the same thing (and let's you choose your editor). I haven't tried it myself, but reviews of the extension are very good.