The most important feature of LGTD is how it coordinates and syncs two separate next action lists: the project-centric list (“projects.gtd”) and the context-centric list (“contexts.gtd”). (Examples of these lists are given in the first LGTD post.) The coordination is done through a command called “Sort and save,” which looks like this:

It’s Key Equivalent is Command-S, so it intercepts the usual action of saving the current document and does its own things instead. The first thing it does, fortunately, is save the current document, so it meets your expectation that Command-S saves. It then runs the given shell script. This script is a simple front end to a pair of more complicated Perl scripts which do the real work of coordinating the two files. If you’re editing projects.gtd, contexts.gtd will be rewritten to reflect the changes you made. Conversely, if you’re editing contexts.gtd, then projects.gtd will be rewritten. By tying this behavior to the habitual action of hitting Command-S, the two files will stay in sync.

The Perl program that rewrites contexts.gtd based on the contents of projects.gtd is called “projects2contexts.pl” and looks like this

These programs are pretty simple. About the only tricky thing in them is how “Waiting for” items are handled. I suppose I could have handled them as just another set of next actions with a context of “waiting,” but since they’re not actually things I’m going to do, I like to keep them separate.

The other LGTD command is “Print HPDA card.”

This simply calls a Perl script, “hpdaprint.pl,” which I originally wrote in July and discussed in this post. The version bundled with LGTD is slightly different, because it takes the PostScript output of html2ps and converts it to PDF before piping it to the printer.

The program assumes you want the index cards printed from your default printer. If that’s not the case, you’ll have to change this line

my $lpr = "lpr -o ManualFeed=True";

to something like this

my $lpr = "lpr -P printer_name -o ManualFeed=True";

So that’s it. These five posts, taken together, are a complete, if not entirely coherent, description of LGTD. Since most of its functionality comes from these three Perl scripts, it could be easily adapted to work in vim, Emacs, or BBEdit. But such adaptations are, as they say in math textbooks, left as an exercise for the reader.