Hooked on org-mode

January 10, 2012 at 08:46 PM | categories: emacs, vim | View Comments

So, what's a long-time ViM user doing with an Emacs session running all the time? Using org-mode of course.

First a little bit of a problem statement: I forget everything. I've tried lots of different ways to solve the problem. I started with writing a TODO list at the beginning of each day. For a while I succeeded in using a Palm Pilot to keep track of everything. Next was a Google Calendar. For stuff that didn't fit in the calendar I tried to keep a personal wiki. Each method ended up in failure because it was cumbersome. Let me be clear, to me cumbersome means requires more work than typing on a keyboard.

I was pretty excited when I heard about org-mode. Look at the slogan: Your Life in Plain Text. How could that not be good? Not being a Saint in the Church of Emacs it took me a little longer to get comfortable with org-mode, but it was worth it. I'm sure my org-mode use hardly scratches the surface of what's possible, but it's been enough to keep me organized for the past year.

Here's what it took to get started. I created a directory called ~/notes and added the following to my Emacs startup files:

(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)

(setq org-log-done t)
(setq org-log-repeat "time")

(add-hook 'org-mode-hook 'turn-on-auto-fill)

(setq org-directory "~/notes")
(setq org-agenda-files (file-expand-wildcards "~/notes/*.org"))

Whenever I want to record something I open up a relevant .org file in ~/notes and add entries like this:

* Chores
** Empty garbages
** Mow lawn

It's just an outline, with the number of leading * characters determining the level of each entry.

The only keys I really use frequently are:

  • C-c C-t: transition states (make this a TODO or mark it done)
  • C-c C-s: schedule this entry
  • C-c C-d: set a deadline for this entry
  • Tab: fold (show/hide children of this entry)
  • C-c a a: show the agenda for the current week

org-mode is far more customizable, but for me, that's enough. I'm especially pleased at how easy it is just to start logging things that happen in a meeting or adding something that I just remembered needing to do around the house. There's almost no friction. And everything about the entry lives in the text file. Then, with a few key presses (C-c a a) I know what my next week looks like.