Macromates TextMate

Martin Dittus · 2005-07-07 · reviews, software, tools · 3 comments

I've just started using TextMate. My initial assumption was that it is still early in the development process, so I planned to wait for a later release before I would decide if I should register a copy; but then I started using it for a couple of days and found several functions that blew me away.

A tip of the day introduced the "^R" shortcut that executes the current line as shell script and inserts the output into your document; this is quite useful to me as I'm starting to use the shell and especially shell scripts for various text management functions and plan to do even more so in the future.

After playing around with this for a while I decided to browse the application menu for other useful tools, and found the "Run Command" section in the "Automation" menu. My initial assumption was that this is a categorized list of scripts or macros that can be edited and appended by the user, and so I was surprised that quite a large amount of the individual menu entries had not only shortcut keys assigned to them, but those shortcut keys were even shown in the menu entry of the respective command. It's a somewhat sad statement about the state of application development, but I was impressed by such a seamless integration of customizable functionality into the application. (By the way I just checked: these commands are shell scripts! Very cool. Thank god they didn't use AppleScript... ;)

Anyway. While browsing the list of those preconfigured commands I found an entry called "TODO", and assumed this would open a separate document that I could use to manage my todo-list, but what actually happened was even better: the command searches documents for lines with the string "todo" and collects those lines in a list. This list is then presented to you, HTML formatted, with links that allow you to jump to the respective positions in each document.

I hadn't anticipated such behavior, but being a programmer and former Eclipse-user I already have a habit of marking text and code with "TODO:"-comments, so this tool not only allows me to keep an overview over the state of my work, but even gives me a motivation to be consistent in my application of such markup.

TextMate's TODO command output

This window is opened by TextMate's TODO-command: it collects a list of your TODO-markup of files in the current document's path (see text for details).

Editing the TextMate command scripts

You can easily modify existing commands, and of course write your own. Those commands are quite flexible in regard to what data they are fed and what they can do with the resulting output (see text for details).

Before I found these tools in TextMate I had been thinking about doing my text editing in an outliner instead, because working with longer texts at some point calls for a way to browse the text by its structure. I'm having too many experiences already where valuable time is lost because it takes too much time to find a specific section of text. I'll see if TextMate can help me providing such a structural overview instead; and even if there is no such tool yet, the existence of the TODO-command makes me confident that there is still the option to develop this functionality yourself. Because you would do it as a shell script there's not much additional overhead in learning the application environment, and you end up with a script that is useful to you even if you at some point you decide to stop using TextMate.

To sum up: very nice application-slash-toolbox. It seems like an impressive combination of good text editor, automation toolkit, and shell script environment that integrates de-facto standards in such a way that I don't really have to change the way I work to profit from the available tools.

Note that there are still areas where you feel the early stage of the development process, and sometimes the documentation is not up to date with the progress of the application; but for me TextMate is in a usable state, and there already seems to be a vibrant community discussing the tools and sharing tips (unfortunately the discussion is via a mailing list, not an online forum). I expect TextMate to become the text editor and productivity environment of choice for a lot of people during the course of the next year. Count me in.

Edit:By the way, take a look at the Macromates blog where they share some of the thought processes while working on new TextMate functionality. Interesting read, and gives further insight into TextMate's potential; for example the current posting about programming language scopes in the editor.


Next article:

Previous article:

Recent articles:

Comments

Good for you.

martin, 2005-08-10 21:31 CET (+0100) Link


Just in case you haven't yet found it, the structure browser you're looking for is (in recent versions) right at the bottom of the window :) They're called "symbols", for whatever reason.

Depending on what mode you're in, it'll recognize function names, s, whatever. Not sure when you're in plaintext, but I'm sure it could be customizer to match a regex or whatever.

doug, 2006-06-09 22:04 CET (+0100) Link


Yeah I know that one -- but never use it. It's a popup menu (as opposed to a tree widget) which means it requires too many clicks for me to be useful...

And it's not really useful in the context of plain text files, especially when you compare it to the capabilities of an outliner.

Martin Dittus, 2006-06-09 23:15 CET (+0100) Link


Comments are closed. You can contact me instead.