Weekend Project: Getting Organized with Emacs Org-Mode

1185

 

Fancy planners and complicated systems may be more trouble than they’re worth when trying to get organized. But Linux users have a secret weapon for getting organized that’s as simple as writing a text file: Org-Mode for GNU Emacs. It has the simplicity of Taskpaper, but can expand to do much more. Why not spend some time this weekend learning your way around Org-Mode, and be fully prepared for work on Monday?

I know what you’re thinking — Emacs is just too complicated. Being a Vim guy myself, I was not eager to jump into working with Emacs. But I’ve heard outlandishly good things about Org-Mode for years, and decided that it was time to give it a whirl. It doesn’t matter if you’re a die-hard Vim fan, do all your text editing in gedit, or prefer to do your editing in nano. You can use Org-mode side-by-side with your favorite editor and simply use Emacs to get organized.

If this sounds like a whole lot of work for a plain-text todo list, you’re right. It would be a lot of work for just a plain-text todo list! But Org-mode is quite a bit more, it just lets you start simply. Carsten Dominik, who developed Org-mode, has this advice:

Don’t try to set up the “final” task managing system from the start. Because you have no idea yet what your system should look like. Don’t set up many TODO states and logging initially, before you actually have a feeling for what you working flow is. Don’t define a context tag “@computer” just because David Allen has one, even though you are sitting at a computer all the time anyway! Start by creating and managing a small TODO list and then develop your own system as the needs arises. I wrote Org-mode to enable this development process.

Like many things on Linux, you’ll benefit from starting small and developing an understanding of how to do simple things and build on them. Let’s get started.

Getting Started with Org-mode

The first thing to do, obviously, is to install Emacs and the Org-mode package itself. These should be packaged for any major Linux distribution — though Emacs is probably not installed by default because it tends to be a fairly hefty package. As a side note, I should mention that GNU Emacs and Org-mode are available for other platforms — not exclusive to Linux — but that’s obviously our focus here.

Emacs and Org-mode packages should be easy to find with Yum, APT, or Zypper, or whatever GUI tools you use to install packages on your system. Once the packages are installed you need to create and/or edit your Emacs configuration (~/.emacs) with:


(require 'org-install)
(add-to-list 'auto-mode-alist '("\.org$" . org-mode))
(define-key global-map "C-cl" 'org-store-link)
(define-key global-map "C-cc" 'org-capture)
(define-key global-map "C-cb" 'org-iswitchb)
(define-key global-map "C-ca" 'org-agenda)
(setq org-log-done t)

Save that, and run emacs todo.org. Now you’re running Emacs with Org-mode goodness enabled.

Using Org-mode

Now it’s time to start using Org-mode. Let’s start simple with the todo.org file that you’ve already opened. Let’s start with a header:

* Todo List

That’s just a line prefixed with an asterisk. Simple so far, right? Let’s add a few items to the list. How about this?

** Start using Org-mode Ctrl-c Ctrl-t

That’s entered just as you see it — a line beginning with two asterisks, and then the description and the Ctrl-c Ctrl-t tells Emacs that this is a todo item. When you’re done you’ll see this:

** TODO Start using Org-mode

You can enter more information after the entry and it will just be treated as part of the todo entry. To start a new todo item, just use ** descriptionCtrl-c Ctrl-t.

Setting Deadlines

Enter a few more items so that you’ve got a decent list to play with. Now, some of your todo list probably comes with a deadline, right? Let’s attach that to a todo item. Make sure you’re on the item that you want to assign a deadline and type Ctrl-c Ctrl-d. Now you can select the deadline from the calendar.

You can also select a scheduled date instead using Ctrl-c Ctrl-s.

To see all deadlines in an Org-mode agenda, use Ctrl-c / d. That’s Ctrl-c then the / and then d.

As you add more entries, you can create sub-entries as well with three asterisks. So you might have a Org-mode file that looks like this:


* My todo list
** High priority assignment
*** First task
*** Second task
** Another thing
*** First task

That can get very complex, so you might only want to see one set of items. You can do this by using Tab to cycle through displaying just the top headings or all headings.

Exporting

What are the odds you’re always sitting in front of the computer? Yeah, me too. But some people actually go to meetings or need to have their todo list outside of Emacs. One way to do that is to use the export function to publish your todo list outside Emacs. You can do this with HTML, plain text, LaTeX, and much more.

Use Ctrl-c Ctrl-e and Emacs will bring up a list of options that includes exporting to iCal, HTML, plain text, and so on. I usually just go with the HTML, so that’s h for a file, or b to export and open it in a browser. If your file is tasks.org this will create a tasks.html in the current directory.

Summary

If Web-based or more structured organizers haven’t gotten the job done for you, Org-mode is very much worth a look. The fact that it runs within GNU Emacs shouldn’t intimidate you, if you’re not an Emacs user. Virtually everything is doable from the menu if you don’t grok Emacs’ shortcuts.

I’ve really only scraped the surface of Org-mode here. You can and should spend some time looking over the Org tutorials that help you get started with everything from using Org-mode as a Getting Things Done (GTD) tool, to using it as a spreadsheet system. There’s very little limit to what you can do in Emacs with Org-mode.