TextMate

It finally happened: I dragged Xcode and BBEdit from my Dock. In their place: TextMate.

This is but a very small list of why I’ve switched:

  • Awesome tab-completion
  • svn integration
  • TODO/FIXME etc support
  • Build with Xcode from within the app, with in-app clickable error display etc
  • Coloured diff or compare
  • Integration with Transmit for (S)FTP
  • Column selection and Edit Each Line
  • Usable from the shell (via the mate command)
  • Only about €39 (£25 or thereabouts)
  • Excellent Go To File and Go To Symbol search
  • Loads of useful built-in macros for all the languages I work with
  • Converts var_names_like_this to varNamesLikeThis with a keystroke
  • Integrates with language and API documentation (including local Cocoa docs)
  • Projects support, including scratch projects
  • Support for running unit tests without leaving the editor
  • Everything is configurable – I can readily add support for, say, highlighting django template tags within HTML documents, or alter existing syntax highlighting rules, commands and so on. And I can do it in a way that means I actually will do it: via changing regular expressions, editing CSS-like scoping rules, setting environment variables and such. Stuff that I can do immediately and easily, instead of trying to write a creaky and unintuitive AppleScript, or (worse) a whole compiled plugin using an arbitrary API
  • I can create syntax-highlighting themes which are ultra-specific or quite general in their highlighted entities; I’m not forced to just choose colours for a fixed, predetermined number of entity types
  • It seems to handle long syntax-highlighted files (say a few thousand lines) faster than the current version of BBEdit (surprisingly) or Xcode (not so surprisingly)
  • And tons more

I can’t see myself going back to BBEdit, though of course I’ll be trying the Leopard version of Xcode. TextMate just feels totally right, and I’m already much more productive than in BBEdit. Never thought I’d see the day, but there you have it.

13 comments

  1. Make sure you don’t throw BBEdit away just yet.

    It is a nice editor, but Textmate performs horrifically slowly in a couple of places where TextWrangler (and I assume BBEdit) is pretty much instantaneous. By horrifically slowly, I mean 30 minutes and more…

    I think this is because of how TM represents structured text in memory, whereas TextWrangler is far more “dumb”, but for whatever the reason if you ever need to hack on (say) big XML files with long lines you will want to fire up BBEdit.

  2. I congratulate you – TextMate is an excellent app.

    I would switch myself from Xcode but there are three things stopping me:
    In Xcode there is that menu that let’s you jump to a method in a file
    I jump around files a lot and TextMate just isn’t suited to large projects with lots of files
    CodeSense! I find it odd that an editor with such great completion features lacks such a basic feature.

  3. Hey Alex,

    If you mean the symbol popup in Xcode above the document contents (ctrl-2), TextMate actually has a better one in the bar at the bottom of the document window (cmd-shift-T, as I recall), which like both BBEdit and Xcode is aware of #pragma marks. TM also does the “switch to counterpart” thing with the same keyboard shortcut.

    As for CodeSense, yep I do miss it a bit. But then I lived without it in Xcode/Project Builder for years. I’ll see how I go with it.

  4. TextMate introduced a CodeSense-like feature in build 1310. Read more about it here: http://theocacao.com/document.page/332

  5. Sweet (re the CodeSense-like feature). I pretty much never used CodeSense to “see what’s available” – I always used it as a typing-saver – so TextMate’s implementation is perfect for me. Well, almost perfect: I’d like it to continue to filter based on my keystrokes once I’ve triggered it, like the Go To Symbol/File panels, but I bet I could add that myself.

    Oh, and two other things I’ve noticed which I like: it generates lorem ipsum (type “lorem” and press Tab) and it has a syntax highlighting scheme for release notes (bound to “.tmReleaseNotes” documents by default, but I’ve added “.releaseNotes” too).

  6. but Textmate performs horrifically slowly in a couple of places where TextWrangler (and I assume BBEdit) is pretty much instantaneous

    Huh?

  7. The main performance issues I saw were discussed on the Textmate list back in May.

    Looking back, I was wrong. It took *hours* to replace “>” with “>\n” in TextMate, and seconds in TextWrangler.

  8. Try opening a Pages XML document in TextMate and then TextWrangler. TextWrangler is home with its feet up by the time TextMate gets it done.

  9. Yes, there are TextMate performance issues with very large documents (multi-megabytes). Allan knows about it, knows it’s a big problem, and will fix it in time.

    Dale: I just tried that, and TextMate opened the Pages window instantly. ??

    OffTopic: the XML looks horribly inefficient. That explains why loading Pages documents (in Pages) can be slow.

  10. Pages window == XML window, I mean.

    I’m using the latest TextMate, though. Earlier versions would be stuck waiting for the syntax highlight to finish. That’s been fixed for a long time. Maybe Dale tried an older version?

  11. Chris: I’m using the latest TM, version 1.5.4 (Build 1324) on an iMac G5/2Ghz. Just opened a 260KB Pages generated XML document in TM. I gave up waiting for it to be displayed in TM after 3 minutes. I estimate it took about 4-5 mins to open this document. The worst part is that it blocks every app for about 1 min at a time, stopping me from doing anything else. By way of contrast, TextWrangler launches and opens the file in 7 seconds. I know there’s nothing screwy with my Mac, so this has to be a performance issue with TM.

  12. I started writing my thesis in Vim, using LaTeX, and then decided to try TextMate. I’m amazed by the fact that it’s clean and simple without losing extra power for more advanced users. But the bottom line is that by the time my file approached 64kB in size, TextMate was not responsive anymore (on new MacBook). It was able to work, but the delay after every keypress was annoying. Looks like I will stay with Vim at the end.

  13. Re my previous comment:

    When I looked into the issue checking CPU usage with Activity Monitor I found out that the bottleneck was “Check Spelling as You Type” turned on and CocoAspell eating resources when typing. Sorry TextMate, looks like this is not your fault after all!

Leave a comment