Thank-you for calling 911, our office hours are from…
Thank-you for calling 911, our office hours are from…
Me Lovey TextMateI remember trying TextMate back when it sucked, around 1.0 or 1.1 or something like that. It was this bastard program that everyone hyped for RoR development and called insanely cool and yadda yadda. Everyone was raving. So I downloaded it and tried it out. I hated it. It broke everything I knew and loved about the Mac in terms of how it worked, and I kept accidentally triggering macros and didn’t see the point to code folding and, really, it was a strange new land that I was totally not ready for. About a year passed, I think, and I was at a WWDC session this past summer when much of the session was about using TextMate to speed up development. Then I see that some of TextMate’s ideas were incorporated into Xcode 3.0 (code folding, for one). Later, I’m two rows behind Allen as he won an award for the best Mac OS X developer tool. Obviously, I’m missing something. I ignore it and plow on. I’ve got code to write and can’t be bothered. I let time pass as I write the traditional way in Xcode and TextWrangler and just keep going. Then MacWorld comes around and I find myself in San Francisco again and I see a little mini-booth for TextMate with some very happy people around it. We chat, he shows me how TextMate actually functions like Xcode in many ways when source code is open, letting you build and test and so on as you go. To debug, sure, go back to Xcode, but for the majority of your work you can live in TextMate. Then, for kicks, off we went making macros and seeing what it can do for Ruby and PHP as well. Impressed, but not convinced, I chugged on. “They’ve made a respectable little niche program there,” I would say unto myself for no reason. That’s about where my fascination ended. Then, oh then, I mentioned my nonplus attitude towards TextMate in an IRC channel of Mac developers. Sure, it’s quite powerful, but Xcode is fine for me right now. Yeah, that didn’t go over so well. After much discussion, and my fishing for advice in another IRC channel (I’m stubborn) I was given a task. Get the latest version, create a new Xcode project, and just write something stupid. Use as many macros and tricks as the menus expose and see how I like it then. So, off I went. Time passes, and the demo is counting down on two machines now, and my little trash can is bulging with the screams of TextWrangler coming from within, and SubEthaEdit watching in horror as drag it off the dock and let it go in an unimpressive poof. I can’t explain why. Part of it is really kind of crazy to me. In the end, this is just another text editor. But, there’s something about the way that it completes the right things, pairs the right punctuation and brackets, and appears to know what I’m doing as I do it that really makes things easier. It’s so very nice to start writing a nested Obj-C call and have TextMate not only pair the brackets up, but pair them up at the right levels as well. Say I wrote: [[NSSomethingSomething sharedSomething] getObjectForKey:@“foo”] The actual process of me typing would actually go like this: [NSSomethi(esc)(esc) sharedSom(esc) (command-right) getObjectF(esc):@“foo (command-right) ] That might seem a little annoying at first, but consider: [myArrayController setSortDescriptors:[NSArray arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:@“name” ascending:YES] autorelease]]]; It looks nastier, but in time that’s about three times as fast and half as mentally-intensive. Then you keep doing it again and again and now your brain and TextMate have become this frightening hybrid mess of expectations and blessed macro fulfillment that makes just about anything possible in a normal amount of time. The macros are fun as well. Hitting “cdacc(tab)” gives me a pair of accessors for a Core Data property. Using “stracc(tab)” gives the same for strings. There are others, but getting used to those comes in handy for the tedious “getting started” work. Of course, then there’s the strange things it can do. For instance, I’m writing this in Textile and getting a preview in a window on the right. And now, I’m about to hit command-control-P and then you’re going to read this after TextMate, yes, TextMate posts this to the site. It’s like emacs was born again and made usable. |
|
You know the feature I probably like the most about TextMate is how dirt simple it is to extend it. It is so simple I can make a bundle for a single project and not think twice about it. Make tab snippits for all of those variable names you type in constantly, why not. I also really like the snippit templates where you can type ‘img(TAB)’ and get a pre-built image element with default fields you can TAB and Shift-TAB between to flesh out. Making these template snippits is so easy.
I built a bunch for my daily journal. jEntry(TAB) creates the entire journal template. I can just tab between entry points, filling in the date, keywords, and so on. Shell scripts can be run in the snippit generation itself, so I needn’t even insert the date.
The emacs bit is a fair analogy, and you don’t even have to learn LISP — thank the gods for that!
One thing that amuses me is how many keyboard short-cuts it has. In any other program this would be a nightmare, but it does two key things to turn a potential nightmare into something extremely useful. First, ad hoc menus for duplicated shortcuts, with numbered activation. Six keystrokes all doing different but similar things? Not a problem, you get a pop up menu where you only need tap ‘3’ or ‘5’ to choose the one you really want. Secondly, scope! Entire sections of short-cuts come into existence when editing a Markdown file, short-cuts that do not ever get in the way if you are editing a Ruby script. I also like how short-cuts can be defined to very basic usages. There is no reliance upon the Command key like in some programs. Even the (RETURN) key can be a short cut, when in the right scope. Say you are in an HTML list scope, return could mean: Add a close li element, carriage return, indent, start a new li element.
Post new comment