Taskmate ... get more things done with your editor!
“Because home is where my editor is” — ember
Taskmate is a simplistic yet powerful solution for getting more done with your text editor.
Right now it’s implemented as a TextMate bundle, but it should be easily adopted for other scriptable editors. Please let me know if you’ve put something together.
You can read about my motivation to create this bundle here: Taskmate, the perfect GTD tool
How it works
Taskmate enhances files with the extension
.todo with just three features: you can toggle action items, (re)build separate files for tags and you can jump between these files.
As for the generated tag files Taskmate looks for files with the extension
.todo in your current TextMate project and creates one file for every tag that you’ve sticked on you action items.
So, that allows you to have tags like @work, @phone, @home or also @next, @urgent, @today … etc. When can then easily review all action items that have e.g. the tag @phone.
Taskmate assumes that you use the following format:
- Projects: text on a single line that’s no longer than 100 characters and ends with a colon.
- Action items: text on a single line that starts with either a ‘+’ or a ‘-’ followed by a space. The minus sign denotes a pending action, the plus sign denotes a completed item.
- Leading and trailing whitespace are ignored for both projects and action items.
- Tags: text on an action item line that starts with an ‘@’ followed by a number of alphanumerical characters, dash or underscore.
- The tag @completed is followed by a date enclosed in parentheses. The tags @completed and @today are highlighted separately (so @today can have a more noticeable color or fomatting).
E.g. a sample todo file could look like this:
As you can see, there’s a small duplication of information in that a completed action item is both marked with a plus sign and tagged with a @completed tag.
I haven’t found a good way to reduce this though because I both wanted to keep the minus/plus notation to stay more compatible with similiar formats (see the credits below) and allow for an own special tag @completed to easily jump to the generated list of completed items.
Taskmates keybindings are:
- ⌥⌅ toggles a single action item to switch it from pending to completed and vice versa.
- ⇧⌥⌅ rebuilds the tag files.
- ⇧⌥@ adds a tag to the current action item (shows a popup menu with all the tags that you already have on your action items).
- ⌅ jumps to an associated file depending on the current cursor position and file:
- If the cursor is placed on a tag in any file you jump to the tag file for this tag.
- If it’s placed on an action item in a tag file you jump to the source todo file.
Of course, you can assign whatever you like better in the TextMate’s bundle editor.
Autogenerated tag files
It’s worth noting that “rebuild tag files” does exactly what it means :-) The tag files are build from their *.todo source files. There’s no synchronization between these files other than with the “toggle completeness” command.
So if you edit your autogenerated tag files manually (like: add additional tags, change the text of the action item) then the tag file will be out of sync with the source file and you’ll be unable to toggle it’s completeness state. Also, changes like these will be overwritten when you rebuild the tag files later on.
Thus: if you want to edit your action items, first switch to their source (just use ⌅) file and edit them there.
I hope there will be a better solution to this in the future, but I haven’t really figured out how to do it best. If you happen to have some good ideas, let me know!
The base directory
You have quite some options to tell taskmate where it should look for your *.todo source files and put those autogenerated tag files.
First, you can define an environment variable TM_TASKMATE_DIRECTORY and set it to any directory you want. If it’s defined, Taskmate will use it. Second, (assuming that you might be using Taskpaper) Taskmate will look for an environment variable TM_TASKPAPER_DIRECTORY. If it is defined, this one will be used.
If none of the above environment variables is defined, Taskmate will use the current project directory (if you have a project open) or the directory of the current file (if you have just a single file open).
You don’t need to worry about your Taskmate base directory that much. Even if it’s big, Taskmate will run lightning fast nonetheless (mine contains more than 1200 files in more than 250 directories). But if your base directory is really, really huge than you might get Taskmate stuck and irresponsive. (For example it’s most probably a bad idea to set the base directory to your user root directory that contains all your application, application support files etc.)
You can download the Taskmate bundle from here:
To install it just unpack the file and double-click the bundle.
Help to improve this
Of course any feedback, discussion, suggestions, criticism … is highly appreciated! I’d love to learn about how others would do this, how it could be improved or done better, what’s missing and what’s wrong.
There’s a bunch of things that I’d like this tool to do better or do at all.
E.g. I’d really like to have it integrated for more editors than just TextMate. But as I mostly use TextMate it’s highly unlikely that I get around create the hook scripts to integrate Taskmate with, for example, VIM, Emacs, Textpad, … or any other scriptable editor. If you want to do a stab at this, just let me know and I’ll happily help you with it.
Also, the existing TextMate integration could be improved. For example, like you can see from the screenshot above, the tags on a completed line aren’t formatted as italics. That’s because I don’t know how to do that properly, yet.
The Ruby library itself should be coded clean enough to be understood by others. I’m sure it can be optimized for speed though, because I’ve just implemented “the easiest thing that ever could work” and refactored that a bit.
So if you want to help to improve Taskmate somehow, just drop me an email, write a comment on my blog or catch me otherwise.
Taskmate is inspired by Taskpaper by Jesse Grosjean as well as Henriks Tasks bundle for TextMate. It is based on some of the TextMate language definitions but implements its own logic to accomplish some more sophisticated features.
The tagline “Home is where my editor is” is the ingenious brainchild of my buddy and server admin ember
By the way as the TextMate integration of this bundle is based on Henrik’s bundle the same licensing applies to it, i.e. you are free to modify and redistribute it non-commercially, though I would appreciate due credit.