Org-mode Capture Update

I’m pretty satisfied with my org-capture templates, so I decided to post a quick update. Once learned, my Capture templates became the most change-prone parts of my init file (which is inside an org file).

In case you’re new to org-mode and don’t know how this works, Org-mode Capture is sort of a super-quick “new file from template” creator that is baked in. The official documents are a bit confusing (as usual, I find that these are more helpful once you know how to use Org, not so friendly to newbies). Personally, I started my way looking at this post from Howard and worked my way back to basics slowly from there.

The Capture Dispatcher(?) shortcut is C-c c for me.

Here is the code. Please excuse the lack of tabs, markdown and WordPress kill these in cold blood:

(setq org-capture-templates
(quote (
("r" "interruption" entry (file "~/Documents/Archive/OhSnap!.org")
"* %? \n%U" :clock-in t)
("i" "INC" entry (file+headline "~/Documents/Archive/" "Incidents")
"* TODO %?\n %^{Ticket}p %^{ID}p %^{Computer}p %^{Location}p")
("e" "event" entry (file+datetree "~/Documents/Archive/")
"* %?\n" :clock-in t :tree-type week)

r is for Interruption: I constantly get interrupted at work. So much so, as a matter of fact, that this labor day weekend I realized that my stress levels are even higher than originally realized. But that’s for another time. It’s important for me to capture the length of the interruption since these give me an idea of how long (total) my workflow has been interrupted. Since I usually do not use Capture when I work regularly (meaning, just doing my thing without getting interrupted), interruption is pretty accurate to measure unplanned stops. When I take a planned break, I don’t log it as an interruption.

this template is triggered by “r” and shows as “interruption” on the dispatcher. it opens a new entry (an Org header) in my OhSnap!.org file, which is where all my “oh snap!” things go to. I clean it regularly. The entry starts with a * for the header (true for all of them). Then the %? is for where the cursor ends up at, which means I start typing here. \n means break to a new line (kind of like “br” in HTML). The “clock-in t” is “clock-in = true” which means it starts clocking the interruption as soon as I created it. It will stop the clock when I’m done typing and file it away.

i is for INC (ticket) I work in helpdesk environment (though my work extends beyond fixing computers and quick troubleshooting). This means lots of tickets. We work with a system that is web-based and offers less flexibility than desired to catalog our tasks. This template (and in a way, org-mode as a whole) helps me solve this problem and stay organized. Because I often end up asking for a ticket or creating a ticket for a situation (see above about interruptions) I usually create/locate the ticket in our system first, and then hit this combo to copy the details from there.

this template is triggered by “i” and shows as “INC” for incident. Each ticket has a number like so: INC111111. It files the ticket in my weekly org file under the header “Incidents” where I keep these tickets. It creates a new header with a state of TODO automatically, and my cursor waits for me after the TODO keyword. in a new line, it prompts me for the following properties in this order: Ticket number, ID number, Computer (hostname) and location. I can skip one of these if they are not needed by hitting enter. This reassures that I get all the information I need later when I pick up my phone with the synced file.

e is for Event I have a back-and-forth relationship with a journal in Org. This is because my workflow with Org is already made out of a lot of information. I constantly enter notes as tasks develop, rather work related or personal. As I learn new things, I tag them with a “wiki” tag as well, to remember to add them to my wiki org file (the name comes from my old wiki which I had around for two years). Be it as it may, I find that I still need to “vent” or just write something that does not fit under a task. In addition, there’s the separation of work and personal notes that come to play here. I can keep more sensitive stuff in the journal file. Finally, there’s something very soothing for me when I see my journal containing all my different thoughts in one place. So this morning, I decided to create this template yet again.

This template is triggered by “e” and shows as “Event”. It uses Org’s built-in datetree feature, which automatically breaks an org file to headers that describe the year > month > day, or in my case, year > week > day. Since I review my work weekly and reflect every weekend, this format makes sense to me. A new entry for the day (including the time) is created each time I use this, all part of the datetree function. As such, the remainder is rather simple: New header, place cursor here (like before) to describe the header, and create a new line. The tree-type: week does what I explained above, changes from the monthly view to a weekly one.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.