The power of orgmode capture templates

Notice: This blog article is written in English on purpose so that the group members of the LinkedIn GTD group can read it as well. I will post some more articles about orgmode in the future, so stay tuned if you are interested.

Its been a while since I switched back to orgmode for some reasons. For those who aren’t familiar with orgmode, its an extension to the Emacs editor and it maintains structured lists with keywords and tags,
so you can setup your own GTD system with it. Orgmode is sometimes also referenced as „your life in plain text“.

Beginners (like my boss who is actually trying out orgmode too) start with entering their hierarchical lists by hand, its perfectly easy to write down a file like

and so on. Orgmode will highlight the TODO keyword and you can fold and unfold lower hierarchy levels with the TAB key. So far, so good, novice users might be fine with that.

But there is a lot of space for improvement. How about the idea that you capture a todo with just a few keystrokes on the keyboard? This is where the orgmode template system kicks in.

On an abstract level the capture system is activated by a hotkey (on my machine its F6). Once you press this hotkey you get a menu of possible capture templates. In my case the first decision I have to make is „What area of focus is concerned“ since I maintain Lists for work, my private stuff and the things I need to do as the president of a sports club.

Depending on that decision I get to the next menu level that asks me what capture template I want to use. The basic template is just a simple TODO. This template is stored in a text file on my cloud account, so its available on every PC I use. And the TODO template simply looks like this:

So if I call this template, then I will be asked for a description, the heaadline of my TODO entry. After that is entered I see a text buffer that has the cursor on the next free line after the headline, so that I can enter details. Below there is already an orgmode drawer with the logbook for this task and the first entry is a time stamp that records when this task was captured. After filling out the details I just press „C-c C-c“ (control-c twice) and the new TODO entry is filed in the file that covers the selected area of focus under a top level
headline called „Capture“.

The customization code just looks like this:

This is Emacs Lisp and even if it looks like cryptic code its easy to understand and of course well documented in the orgmode manual.

So if I press „F6“ + „p“ (for private stuff) and „t“ for todo the template stored under the filename „Dropbox/org//tpl-todo.org.txt“  will be used to create an entry in the file Dropbox/org/privat.org under the Headline „Capture“.

By using the capture system and the template I can focus on the stuff that is a variable, but the system also records the firs logbook entry for me. And this can get very comfortable if your work life has sort of projects that are always handled in the same way. One of the frequent things I need to do at work is performing a hardware certification which can be treated as a little project.

With the template system its fast and easy to enter the certification request for a new system. The template for it is quite long:

But even if this template is long, all I need to enter is

  • the name of the system to be certified
  • the version of RHEL which should be used

So with just a few keystrokes I file a complete little project in my list for work, logbook entries, standard effort estimates and the first task in the project is marked as NEXT action already.

But this is still not the end of the possibilities that the captures system offers. Besides capturing tasks I also got used to the habit to enter quick unrelated logbook messages or journal entries with the capturing system. The difference between logbook and journal is, that in the logbook I write the ugly details of my work life and its „for my eyes“ only because it contains also entries like „the moron from department x was asking the same stupid question for the 3rd time“, so records my emotions about the work as well. In the journal I just file real achivements and the journal is something that can be presented to the boss if he wants to know.

Capturing a logbook entry is simple:

The logbook is organized as a so called „datetree“ that looks like this, assuming I filed „This is a simple logbook entry“:

Remember that the „*“ headers represent foldable lines, so when you open this file in Emacas you just see the top level „2014“ and on pressing „Tab“ you get the next level.

Entry templates don’t need to be just „one liners“. I have created a template file that holds my checklist for the weekly review and I can file it in my journal with just a few keystrokes.

The possibilities of the orgmode capture system are endless and the advanced use of it saves a lot of time when entering new things into your system.

Captured entries can easily be refiled. Remember that the TODOs from the TODO template all end up under the headline „Capture“. So if I want to move them to the correct hierarchy level on my next review of the task list I just have to place the cursor there and press „C-w“ (control w). Then I’m asked, under which headline the entry should be filed, advanced settings also allow for moving the entry do a different org file.

The orgmode capture template system is something that I have never seen in other GTD tools. Some of them allow basic templates, but not to the level that orgmode does.

There was just one issue I had do find a solution for. Usually all customization is stored in the „~/.emacs“ file on your computer, but if you use orgmode on several machines (thank to cloud storage), then the orgmode templates should be available on all machines. So I extracted the lisp code from „~./emacs“ and moved it to the cloud storage. My Emacs initialization file just has one line at the end, that includes the customization from the cloud storage:

This loads the global customization file „org-global.el“ from Dropbox and so I have all my templates and other global orgmode-settings there. Just need to remember that what I customize using the emacs menus won’t end up there, it still goes to „~/.emacs“ again.

[ratings]