06 Oct 2004
I've had a bit of a chance today to take TextMate for a test drive, and unlike 2lmc and Erik, I must say that I'm pretty impressed on the whole. OK, very impressed. Sure, it has a few rough edges, but it is a beta. And there seems to me to be enough slickness there to promise good things for the future. It's very customisable and expandable, and I'm sure it won't be long before we're flooded with bundles to support syntax colouring, commands and snippets for dozens of languages. For now, the default tools are slanted towards HTML, PHP and Ruby. This is obviously disappointing if you're a Perl geek (or a Shell scripting geek, or a LaTeX geek). However, as I've mentioned before, I'm learning Ruby at the moment and it makes a nice change to find a text editor with really good support for Ruby.
As usual when I try out a new application, I headed for Preferences to see what I could mess about with. Hmm. No Preferences. I'll save you five minutes of hunting around on the menus and tell you that there's no GUI for the preferences. It says in the Help file that you can set some parameters at the command line using defaults write com.macromates.textmate, but you'll be working in the dark. Changes that you make to settings with the application running (like turning line numbers on or off) do seem to get saved automatically between launches. I don't know if there are plans to eventually implement a GUI for the preferences, but it would seem likely.
Another standard command that seems to be missing is Print. I say 'seems' because I can't quite believe that it isn't there — surely I must have just overlooked it somewhere? However, since TextMate includes such comprehensive tools for issuing commands on a selection or the whole document, it ought to be perfectly possible to pipe text out to lpr to print it, though I guess you need to convert it to Postscript first to do it that way.
With those gripes out of the way, let's get on with the cool things about TextMate. First, there are a lot of ways to customise it. You can produce a .plist file to specify syntax colouring and folding according to regular expressions, so it's perfectly possible to provide support for almost any language. You can record macros of editing sequences to automate repetitive sequences. I produced one really quickly to comment or uncomment selections with a # character. Your last macro is stored as a 'scratch' macro, that you can replay until you record another, but if you want to keep it, you can save it with a name and an optional hot key. Commands can also be stored. These are fragments of script (any of the scripting languages that MacOS X understands — Shell, Perl, Ruby, Python or Applescript) that can be performed on either the selection or the entire document. This is an enormously powerful feature, as you can either overwrite the document (or selection) with the result, insert it at the end, put it on the clipboard, show it as a tooltip or open an new document window. There's a nice example in the help file of setting up a command to search your document for the word under the cursor. It then shows you the lines containing the word in a separate window, and because it stores the line numbers for the results, you can select a line in the results window and see that line highlighted in your file. I set up a very simple command to send the selected text as Standard Input to wc -w and show the results in a tool tip. This means that I can select a block of text (or the whole document), and get the number of words in the selection in a tool tip.
There are snippets, which allow you to insert a mini template for some repetitively-used text (an if statement, an HTML anchor or a PHP statement, for example), and you can filter a selection through a command, which is ideal for munging text. Just to round things off, it's possible to write a line of code in your document and execute that line, inserting the result. This is handy for getting the current date, using the Unix date command, but it would be neater if you could choose whether or not to overwrite the line of code itself.
I think this is the really strong point of TextMate: if you have the ability to add in functionality (provided that you have a bit of scripting know-how), you can build a text editor with exactly the features you need and no bloat. It's like Vim in that respect. Even if you don't have the know-how, syntax files, commands and snippets can be packaged up in a bundle, so users can share useful tools they have created.
Lastly (but not leastly), I think that TextMate looks like it belongs in MacOS X. The tabs are pretty (in my opinion), and the folding is neat. If you fold some text and hover over the ellipsis which denotes some folded text you get a tool tip showing you what's hidden. That's a nice touch.
TextMate seems to be really polarising opinion. Perhaps we'll look back on the 6th of October as the day when Mac users got their own Emacs/vi-style holy war. "Ah, yes Grandaughter. I was there back in '04 when the BBEdit/TextMate wars started..."
2
pete: I think that the comparisons with BBEdit are being made because BBEdit is pretty much the state of the art as far as graphical editors go on MacOS X. You might be right about TextWrangler being a fairer comparison, but it's difficult to be exact because so much of the functionality of TextMate isn't built-in, but is available if you build it yourself. You're right that there's no AppleScript support yet, though you can use chunks of AS in commands viaosascript commands.
3
[...] â Richard @ 20:24 TextMate ist ein neuer Texteditor für Mac OS X, der gerade die Runde macht. Bisher habe ich noch keinen vernünftigen Texte [...]by Richard Cyganiak's Weblog » TextMate: Noch nich @ 08/10/2004 6:10 pm • Permalink
4
[...] â Richard @ 20:24 TextMate ist ein neuer Texteditor für Mac OS X, der gerade die Runde macht. Bisher habe ich noch keinen vernünftigen Texte [...]by Richard Cyganiak's Weblog » TextMate: Noch nich @ 08/10/2004 6:10 pm • Permalink
5
How does it compare to skEdit?6
Matthew: That's an interesting question. I think it depends what your primary use for a text editor is. I'm increasingly of the opinion that it's difficult to create a text editor that does HTML/CSS as well as other kinds of coding or plain text files. I have skEdit, and still prefer it for editing HTML because of the great code hinting that it uses. However, for editing any other kind of code or text, I much prefer TextMate. HTML and CSS is so much more heavily structured than other languages, with lots of built-in attributes which are only valid in particular contexts. If you try to add help with all of that to a general purpose text editor, you run the risk of adding a lot of bloat. I'm personally happy to use separate editors for HTML and everything else. -----
1
OS X Editors There is remarkable buzz on the web about a new editor for OS X called TextMate. Like John Gruber [1], I am a little mystified, especially about why it seems to be pitched to Windows users with this tagline âthink...----- Thanks for breaking the news - there's nothing I love better than a new Mac app to play with! I like the look of some of the features of TextMate - folding, for example (it's about time more apps - not just the boney ones - had this!). I wonder why people are talking about it in the same breath as BBEdit... The price difference reflects the difference in functionality pretty well, it seems to me. Perhaps comparisons with TextWrangler might be more suitable. I'm not convinced there's much AppleScript support either.by pete @ 06/10/2004 8:10 pm • Permalink