Skip to content

Instantly share code, notes, and snippets.

@rlb3
Created December 4, 2014 20:06
Show Gist options
  • Save rlb3/75aa5dbdb5527e032e17 to your computer and use it in GitHub Desktop.
Save rlb3/75aa5dbdb5527e032e17 to your computer and use it in GitHub Desktop.
Orgmode Tutorial

Orgmode Tutorial

Todo list

  • State “DONE” from “TODO” [2012-02-15 Wed 08:05]
  • Title
  • Todo
  • Headers
  • Tags

I’m going to start a little series on org-mode. If you find it boring or want to talk about something else let me know.

The first use of org-mode is a todo list.

Headlines start with a *. For example:

* Case 42453: Fix spelling error

Multiple * will setup a hierarchy so that when you hit [tab] on a Headline at the top of the hierarchy the rest will be folded under it.

* Top
** Detail

Hitting tab on Top will result in

* Top...

The ellipses alway mark that something is underneath that header.

To mark something as a TODO you must be on a header line at hit S-right. That is the Shift and the Right arrow. This will add the keyword TODO to the RIght after the ‘*’. This can also be done with C-c C-t.

You can also add more TODO keywords by adding lines like this to the top of your file:

#+TODO: TODO | DONE
#+TODO: CASE BUG KNOWNCAUSE | FIXED
#+TODO: | CANCELED

Remember to C-c when you add headers like this to the file.

Keyword after the pipe are consider Closed conditions for the TODO. Also as you S-right the keywords will cycle through the list.

Tags may also be added for any headline. As when adding TODO keywords you must be on the line of the header then hit C-c C-c. In the minibuffer you will be asked for the name of a tag.

Once added a take will look like this:

* Start orgmode tutorial :blog:

The colons will be add for you. The next time you want to add a tag in the minibuffer you can use tab completion to find previously added tags. You can also add more than one tag. In the minibuffer you just need to separate the tags with a colon. For example:

* Start orgmode tutorial :blog:

You can also add tags to the top of the file like the todo keywords.

#+TAGS: @work @home
#+TAGS: laptop car

Tags can have letters, numbers, the _ and @.

That’s all for today. I’m think about org-mode agendas for next time.

Agendas

  • State “DONE” from “STARTED” [2012-02-17 Fri 12:50]
  • Scheduled
  • Deadlines
  • Properties
  • Searching

    Before we talk about Agendas in org-mode I need to add two more things that I forgot to add last time. The first are a few basic global key bindings you should have for org-mode in your .emacs file.

    (global-set-key "\C-cl" 'org-store-link) (ref:store)
    (global-set-key "\C-ca" 'org-agenda)     (ref:agenda)
    (global-set-key "\C-cb" 'org-iswitchb)   (ref:iswitchb)
        
    • (store) org-store-link will allow you to setup links anywhere in emacs.
    • (agenda) org-agenda will bring up the Agenda dispatcher.
    • (iswitchb) org-iswitchb Allows you to switch between org-mode buffers.

      The second thing are properties. Properties are key value pairs that can be add to any heading. To create one use “C-c C-x p”. It looks like this:

      :PROPERTIES:
      :Case:     34243
      :Effort:   4h
      :END:
              

      To add more properties use the same keyboard command as before as long as you are under the same heading it will let you add a new key value pair. The main difference between tags and properties is that properties don’t show up when you export the file to a different format. There usefulness will be more obvious in the agenda.

      When you bring up the Agenda and choose the option ‘a’ for The weekly agenda, you see something like this:

      Week-agenda (W07):
      Monday     13 February 2012 W07
      Tuesday    14 February 2012
      Wednesday  15 February 2012
        org-tutorial:Scheduled:  STARTED Agendas                  :blog:
        org-tutorial:Scheduled:  TODO Plain Lists                 :blog:
        org-tutorial:Scheduled:  TODO Markup                      :blog:
        org-tutorial:Scheduled:  TODO Tables                      :blog:
        org-tutorial:Scheduled:  TODO Spreadsheet                 :blog:
        org-tutorial:Scheduled:  TODO Babel                       :blog:
      Thursday   16 February 2012
      Friday     17 February 2012
        org-tutorial:Sched. 3x:  STARTED Agendas                  :blog:
        org-tutorial:Sched. 3x:  TODO Plain Lists                 :blog:
        org-tutorial:Sched. 3x:  TODO Markup                      :blog:
        org-tutorial:Sched. 3x:  TODO Tables                      :blog:
        org-tutorial:Sched. 3x:  TODO Spreadsheet                 :blog:
        org-tutorial:Sched. 3x:  TODO Babel                       :blog:
      Saturday   18 February 2012
      Sunday     19 February 2012
              

      As you can see, it shows you the days of the week, what file the item came from when something was scheduled, what’s scheduled for the day and the tags. You move up and down with the keys ‘p’ and ‘n’. Quit with ‘q’. And if you move to a line hit ‘return’ you will be taken to that file and to the line of the item.

      I use the weekly agenda the most but after that I use the ‘m’ option that allows you to search for tags and properties.

      The other options are also useful. They can be found here http://orgmode.org/manual/Agenda-dispatcher.html#Agenda-dispatcher.

      Well that’s the basics of org-agendas. Next time the topic will be plain lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment