The Pug Automatic

Tasks bundle for TextMate

Written August 11, 2007. Tagged OS X, TextMate.

I came across TaskPaper the other day – a simplistic to-do list app currently in development by Jesse Grosjean, who made the equally simplistic text editor WriteRoom.

In TaskPaper, your to-do list is in a simple text format like

Project 1:
- task 1
- task 2 @done
Project 2:
- task 3

and presented with visual and functional improvements.

I'm a big fan of piggybacking on formats like this: taking something people are already doing, like this list markup, and adding value. The to-do lists I keep in plain text files are pretty much formatted this way, except for the tags (like @done).

However, I edit my text files in TextMate. Using something else for to-do list text files complicates things. So I made a TextMate bundle for it:

[Screenshot]

Download it here, unarchive, then double-click to install: Tasks.tmbundle.zip

It's named "Tasks" rather than "To-do" since a "TODO" bundle ships with TextMate (it finds "TODO" and "FIXME" comments in code).

This is a pretty simple bundle. I don't need any special handling of priorities or due-dates. Feel free to modify it to fit your preferred markup and way of working.

File format

The Tasks grammar and commands by default apply to files with the .todo, .todolist and .tasks extensions.

Headers end with a colon (":"). Headers are listed in the symbol list. Somewhat unfortunately, checkmarks are used in the symbol list to denote the current item. That checkmark obviously does not reflect the to-do status of anything.

Pending (uncompleted) tasks start with a hyphen ("-"). Completed tasks start with a checkmark ("✓"). The easiest way to get the checkmarks is to first add a pending task and then toggle it using the command described below.

Headers and tasks can be indented for grouping/hierarchy, as seen in the screenshot above.

Commands

New Task

Press to insert a new task.

The command has some smarts: if the caret is on the same line as a task but before the hyphen/checkmark, the new task is inserted above; if the caret is after a task, the task is inserted below. If the caret is inside the task, the line breaks, splitting the task in two. If the caret is on a blank line, a new task is inserted there without adding line breaks.

Toggle Completed

Press ⌥⌅ to toggle completion for a task or set of tasks.

If no text is selected, the task on the current line is toggled: if it's pending, it's marked as completed and vice versa.

If text is selected, every task in the selection is toggled in batch: if any of the tasks are pending, all are marked as completed; if all are completed, they're marked as pending.

Other commands

In addition to these specific commands, you can obviously use general TextMate features like undo, Duplicate Line (⌃⇧D), Current Date (isoD⇥), move lines up (⌃⌘↑) and down (⌃⌘↓)…

There. That's one less thing to do.