Click here to Skip to main content
16,011,447 members
Articles / All Topics

Organize Everything With Org Mode

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
8 Jun 2012CC (ASA 3U)3 min read 7.2K   1  
Organize everything with Org mode

I used to use Vim exclusively, but I decided to try Emacs out recently and realized that nobody wins the editor war; they’re both good at different things. One awesome feature of Emacs is the Org Mode.

Fundamentally, Org Mode is just a powerful outliner. It’s incredibly feature packed, so I’ll go through some of my favourite features for organizing projects. The full manual is available here.

Getting Org

First, install Emacs (apt-get install emacs, http://ftp.gnu.org/gnu/emacs/windows/http://emacsformacosx.com/, or whatever) if you don’t have it. Your distribution may have an old version of Org, so use the package manager to get the newest version.

M-x package-install [Enter]
org [Enter]

Starting With Org

Open file with the ‘.org’ extension and Org Mode will automatically start.

C-x C-f test.org

Working With Trees

Org is an outliner: it stores data in trees. To make a root level node, start a line with an asterisk (*). You can create new nodes with C-[Enter], and change the depth of a node use M-[Right Arrow] and M-[Left Arrow]. To expand and collapse a tree, go to a node and press [Tab]. It will cycle through three states: folded (only root node visible), children (only root and children visible), and subtree (all nodes visible). Under a node, you can put whatever you’d like. For lists that are not part of the tree, use ‘+’ or ‘-’ as bullets.

Get Things Done

Any node can become a TODO item. With the cursor on the line of a node, press C-c C-t. This will toggle the TODO status. By default, it will cycle through none, TODO, and DONE. This can be modified.

TODO items can have deadlines. These go on the line below the item and start with ‘DEADLINE:’. With the cursor on a todo item, use C-c C-d to insert a deadline. Use C-c C-s to set an item as scheduled. TODO items can also have priorities. To set or clear a priority, press C-c , with the cursor on a node.

Once you set up dates and priorities, you can sort the items. Go to the parent node of your TODO items, press C-c ^and select a sort criteria.

Here’s an example of some TODO items with priorities and deadlines:

** Things To Do
*** DONE [#A] Finish this article
    DEADLINE: 2012-05-06 Sun
*** TODO [#B] Pay Bills
    DEADLINE: 2012-05-10 Thu

Tables

Org has very powerful support for tables. In fact, it has many spreadsheet functions built in. To start a table, start a line with a pipe (|). The pipe character is used as vertical divider. Create your first row like this:

|part|price

Now press C-c C-c. It will auto complete and space the table. Next, add a line starting with ‘|-’  so your table looks like:

| part | price |
|-

Press C-c C-c again. The divider will auto complete. Now let's enter some data. Press [Tab] go to the next cell. [Tab] will continue cycling through cells, and [Shift]+[Tab] will cycle in reverse. Let's add some data using [Tab]:

| part        | price |
|-------------+-------|
| widget      | 10.00 |
| contraption |  5.00 |
| doodad      | 12.00 |

Notice that when the spacing gets off, pressing [Tab] will fix it. Using C-c C-c anywhere in the table will reformat the entire table.

Finally, let's sum the prices. Add a new row like this:

| part        | price |
|-------------+-------|
| widget      | 10.00 |
| contraption |  5.00 |
| doodad      | 12.00 |
|-------------+-------|
| Total       | =vsum(@I..@II) |
|             |       |

When you press tab, it will calculate the sum between the first horizontal line (@I) and the second horizontal line (@II).

Exporting

Need to create shareable documents from your notes? Org Mode can export to a variety of formats. Type...

M-x org-export-as [Tab]

...and check out the list of export options. HTML, LaTeX, and PDF (using LaTeX) are some examples. By default, Org will use your outline to number sections and create a table of contents. This is all configurable, see the manual.

Syncing

If you use Org a lot, you’ll start to collect a lot of data in Org files. Fortunately, they’re just text, so backing up is easy. You can use Dropbox, a version control system (git), or anything else that will host text files. Do this early and get into the habit of keeping everything backed up!

Original Post

License

This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-Share Alike 3.0 Unported License


Written By
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --