Archives For TextMate

As described in the “Calling TextMate from Other Applications”:http://macromates.com/textmate/manual/using_textmate_from_terminal chapter in the “TextMate Manual”:http://macromates.com/textmate/manual/

bq. There is one command which does not support giving arguments in the EDITOR variable, it is crontab (which is sort of obsoleted by launchd). If you need to use it, you can create a symbolic link to mate with a _wait suffix which implies -w.

Well, as I found out a while ago, there’s another command that has the same problem: *sqlplus*. But if you follow Allan’s instructions, you can make TextMate work with sqlplus:

ln -s mate ~/bin/mate_wait   # run this once to create the link
export EDITOR='mate_wait'    # use in your ~/.bash_profile

Assuming you’ve already created a symlink to mate and that ~/bin exists (you could also use /usr/local/bin or some other preferred location). Now, in sqlplus simply type ed or edit as usual, and your commandline will open up in TextMate. Yay, one less reason to ever edit any text outside of TextMate.

After reading “The Pragmatic Programmer”:http://www.amazon.com/exec/obidos/ASIN/020161622X/hvirringdk-20 this summer, I’ve been trying to follow some of their tips, one of them being

bq. *Tip 22: Use a Single Editor Well*
Choose an editor, know it thoroughly, and use it for all editing tasks.

My editor of choice is “TextMate”:http://macromates.com, one of the very first applications I bought for my Mac. I’ve been using it more and more lately, but unfortunately there’s no support for working with Oracle databases. The supplied SQL bundle works only with MySQL and Postgres, and Google wasn’t any help in finding a bundle specifically for Oracle.

After spending a few hours looking into what these “TextMate bundles”:http://macromates.com/wiki/Main/Bundles are, it turns out they’re very, very nifty and it’s not all that difficult to create your own. So, without tiring you with more chatter, I present my first TextMate bundle, the “Oracle Bundle”:http://productive.dk/pub/Oracle.tmbundle.zip.

I could possibly have added Oracle functionality to the existing SQL bundle, but there didn’t seem to be a lot of overlap between MySQL/Postgres and Oracle in terms of the code implementing the bundles, so I decided to create a standalone bundle. So far, it’s only got a few basic features, but I’m hoping to add more as time allows for it. The syntax just piggybacks on the SQL syntax from the SQL bundle, and I haven’t added any support for PL/SQL.

This “preview” has the following commands:

!http://productive.dk/images/oracle-bundle-preview.png(Oracle Bundle Preview)!

Go ahead and “grab your copy here”:http://productive.dk/pub/Oracle.tmbundle.zip.