Org-Mode

Structure

TODO

Key Binding:

Change the TODO state of item

`C-c C-t'
     Rotate the TODO state of the current item among

`C-<n> C-c C-t'
     Numeric prefix argument to quickly select a specific in the state list

`C-u C-c C-t'
     Select a specific keyword using completion or (if it has been set
     up) the fast selection interface.

`S-<right>'
`S-<left>'
     Select the following/preceding TODO state, similar to cycling.
     Useful mostly if more than two TODO states are possible

IN MULTI GROUP

`S-<right>'
`S-<left>'
     `S-<<left>>' and `S-<<right>>' and walk through _all_ keywords

`C-S-<right>'
`C-S-<left>'
     These keys jump from one TODO subset to the next.  In the above

View TODO item list


`C-c C-v'
`C-c / t'
     View TODO items in a sparse tree.

`C-c a t'
     Show the global TODO list.  Collects the TODO items from all agenda
     files (*note Agenda Views::) into a single buffer.  The new buffer

Create new TODO item

`S-M-<RET>'
     Insert a new TODO entry below the current one.

#+ Completion

`M-<TAB>'
     #+ completion

`C-c C-c'
     with the cursor in a line  simply restarting Org mode for the current buffer.
     make the changes known to Org mode.

Customize TODO keyword

Sequence

     (setq org-todo-keywords
       '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))

Type

     (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))

Multi Group

     (setq org-todo-keywords
           '((sequence "TODO" "|" "DONE")
             (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
             (sequence "|" "CANCELED")))

Fast Access States

     (setq org-todo-keywords
           '((sequence "TODO(t)" "|" "DONE(d)")
             (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
             (sequence "|" "CANCELED(c)")))

Per File

Sequence
     #+SEQ_TODO: TODO FEEDBACK VERIFY | DONE CANCELED

Type
     #+TYP_TODO: Fred Sara Lucy Mike | DONE

Multi Group
     #+SEQ_TODO: TODO | DONE
     #+SEQ_TODO: REPORT BUG KNOWNCAUSE | FIXED
     #+SEQ_TODO: | CANCELED

TODO keyword face

     (setq org-todo-keyword-faces
           '(("TODO"      . org-warning)
             ("DEFERRED"  . shadow)
             ("CANCELED"  . (:foreground "blue" :weight bold))))

Log Todo/Done with time and note

**Log Done Time**n

     (setq org-log-done 'time)

Log Done Time and Note

     (setq org-log-done 'note)

Per File

   #+STARTUP: logdone
   #+STARTUP: lognotedone
   #+STARTUP: nologdone

Log Todo State

     (setq org-todo-keywords
       '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)")))

Per File

     #+SEQ_TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@)

Per Subtree

     * TODO Log each state with only a time
       :PROPERTIES:
       :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
       :END:
     * TODO Only log when switching to WAIT, and when repeating
       :PROPERTIES:
       :LOGGING: WAIT(@) logrepeat
       :END:
     * TODO No logging at all
       :PROPERTIES:
       :LOGGING: nil
       :END:

Priorities

Example

     *** TODO [#A] Write letter to Sam Fortune

Key

`C-c ,'
     Set the priority of the current headline.

`S-<up>'
`S-<down>'
     Increase/decrease priority of current headline(1).  Note that these

Variables

`org-highest-priority'
`org-lowest-priority'
`org-default-priority'

Per File

     #+PRIORITIES: A C B

Break down to Sub tasks

append [/] or [%] at the end of each items

     * Organize Party [33%]
     ** TODO Call people [1/2]
     *** TODO Peter
     *** DONE Sarah
     ** TODO Buy food
     ** DONE Talk to neighbor

If you would like a TODO entry to automatically change to DONE when all chilrden are done, you can use the following setup:

     (defun org-summary-todo (n-done n-not-done)
       "Switch entry to DONE when all subentries are done, to TODO otherwise."
       (let (org-log-done org-log-states)   ; turn off logging
         (org-todo (if (= n-not-done 0) "DONE" "TODO"))))

     (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)

Check box for plain list

Example

partial - [-] done/close - [X] none - [ ]

     * TODO Organize party [2/4]
       - [-] call people [1/3]
         - [ ] Peter
         - [X] Sarah
         - [ ] Sam
       - [X] order food
       - [ ] think about what music to play
       - [X] talk to the neighbors

Key Bindings

`C-c C-c'
     Toggle checkbox at point.  With a prefix argument, set it to `[-]',
     which is considered to be an intermediate state.

`C-c C-x C-b'
     Toggle checkbox at point.
        - If there is an active region, toggle the first checkbox in
          the region and set all remaining boxes to the same status as
          the first.  If you want to toggle all boxes in the region
          independently, use a prefix argument.

        - If the cursor is in a headline, toggle checkboxes in the
          region between this headline and the next (so _not_ the
          entire subtree).

        - If there is no active region, just toggle the checkbox at
          point.

`M-S-<RET>'
     Insert a new item with a checkbox.  This works only if the cursor
     is already in a plain list item (*note Plain lists::).

`C-c #'
     Update the checkbox statistics in the current outline entry.  When
     called with a `C-u' prefix, update the entire file.  Checkbox
     statistic cookies are updated automatically if you toggle
     checkboxes with `C-c C-c' and make new ones with `M-S-<RET>'.  If
     you delete boxes or add/change them by hand, use this command to
     get things back into synch.  Or simply toggle any checkbox twice
     with `C-c C-c'.

Tag

Tag Definition

Per File

     #+TAGS: @work @home @tennisclub
     #+TAGS: laptop car pc sailboat

Per File with Short Key

     #+TAGS: @work(w)  @home(h)  @tennisclub(t)  laptop(l)  pc(p)

Per File Grouped

     #+TAGS: { @work(w)  @home(h)  @tennisclub(t) }  laptop(l)  pc(p)

Variable Setting with Short Key

     (setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l)))

Variable Setting with Grouped

     (setq org-tag-alist '((:startgroup . nil)
                           ("@work" . ?w) ("@home" . ?h)
                           ("@tennisclub" . ?t)
                           (:endgroup . nil)
                           ("laptop" . ?l) ("pc" . ?p)))

Add Tag

Key Binding

`M-<TAB>'
     At the end of a headline, after a colon, `M-<TAB>' offers completion on tags

`C-c C-c'
     Enter new tags for the current headline.  Org mode will either
     offer completion or a special single-key interface for setting

   If at least one tag has a selection key then pressing `C-c C-c' will
automatically present you with a special interface, listing inherited
tags, the tags of the current headline, and a list of all valid tags
with corresponding keys(1).  In this interface, you can use the
following keys:

`a-z...'
     Pressing keys assigned to tags will add or remove them from the
     list of tags in the current line.  Selecting a tag in a group of
     mutually exclusive tags will turn off any other tags from that
     group.

`<TAB>'
     Enter a tag in the minibuffer, even if the tag is not in the
     predefined list.  You will be able to complete on all tags present
     in the buffer.

`<SPC>'
     Clear all tags for this line.

`<RET>'
     Accept the modified set.

`C-g'
     Abort without installing changes.

`q'
     If `q' is not assigned to a tag, it aborts like `C-g'.

`!'
     Turn off groups of mutually exclusive tags.  Use this to (as an
     exception) assign several tags from such a group.

`C-c'
     Toggle auto-exit after the next change (see below).  If you are
     using expert mode, the first `C-c' will display the selection
     window.

Search Tag

`C-c \'
`C-c / T'
     Create a sparse tree with all headlines matching a tags search.
     With a `C-u' prefix argument, ignore headlines that are not a TODO
     line.

`C-c a m'
     Create a global list of tag matches from all agenda files.  *Note
     Matching tags and properties::.

`C-c a M'
     Create a global list of tag matches from all agenda files, but
     check only TODO items and force checking subitems (see variable
     `org-tags-match-list-sublevels').

Tag Search Syntax

`+work-boss'
     Select headlines tagged `:work:', but discard those also tagged
     `:boss:'.

`work|laptop'
     Selects lines tagged `:work:' or `:laptop:'.

`work|laptop&night'
     Like before, but require the `:laptop:' lines to be tagged also
     `:night:'.

Multi State TODO keywords:

`work/WAITING'
     Select `:work:'-tagged TODO lines with the specific TODO keyword
     `WAITING'.

`work/!-WAITING-NEXT'
     Select `:work:'-tagged TODO lines that are neither `WAITING' nor
     `NEXT'

`work/+WAITING|+NEXT'
     Select `:work:'-tagged TODO lines that are either `WAITING' or
     `NEXT'.

   Any element of the tag/todo match can be a regular expression - in
this case it must be enclosed in curly braces.  For example,
`work+{^boss.*}' matches headlines that contain the tag `:work:' and
any tag starting with `boss'.

   You can also require a headline to be of a certain level or
category, by writing instead of any TAG an expression like `LEVEL=3' or
`CATEGORY="work"', respectively.  For example, a search
`+LEVEL=3+boss/-DONE' lists all level three headlines that have the tag
`boss' and are _not_ marked with the TODO keyword DONE.

Properties

Syntax

     * CD collection
     ** Classic
     *** Goldberg Variations
         :PROPERTIES:
         :Title:     Goldberg Variations
         :Composer:  J.S. Bach
         :Artist:    Glen Gould
         :Publisher: Deutsche Grammphon
         :NDisks:    1
         :END:

You may define the allowed values for a particular property `:Xyz:' by setting a property `:Xyz_ALL:'. This special property is inherited,

     * CD collection
       :PROPERTIES:
       :NDisks_ALL:  1 2 3 4
       :Publisher_ALL: "Deutsche Grammophon" Phillips EMI
       :END:

or per file setting:

     #+PROPERTY: NDisks_ALL 1 2 3 4

or global setting:

org-global-properties

Property Edit


`M-<TAB>'
     After an initial colon in a line, complete property keys.  All
     keys used in the current file will be offered as possible
     completions.

`C-c C-c'
     With the cursor in a property drawer, this executes property
     commands.

`M-x org-insert-property-drawer'
     Insert a property drawer into the current entry.  The drawer will
     be inserted early in the entry, but after the lines with planning
     information like deadlines.


`C-c C-x p'
     Set a property.  This prompts for a property name and a value.  If
     necessary, the property drawer is created as well.

`C-c C-c s'
     Set a property in the current entry.  Both the property and the
     value can be inserted using completion.

`S-<left>/<right>'
     Switch property at point to the next/previous allowed value.

`C-c C-c d'
     Remove a property from the current entry.

`C-c C-c D'
     Globally remove a property, from all entries in the current file.

`C-c C-c c'
     Compute the property at point, using the operator and scope from
     the nearest column format definition.

Special Properties

The following property names are special and should not be
used as keys in the properties drawer:

     TODO         The TODO keyword of the entry.
     TAGS         The tags defined directly in the headline.
     ALLTAGS      All tags, including inherited ones.
     PRIORITY     The priority of the entry, a string with a single letter.
     DEADLINE     The deadline time string, without the angular brackets.
     SCHEDULED    The scheduling time stamp, without the angular brackets.
     TIMESTAMP    The first keyword-less time stamp in the entry.
     TIMESTAMP_IA The first inactive time stamp in the entry.
     CLOCKSUM     The sum of CLOCK intervals in the subtree.  `org-clock-sum'
                  must be run first to compute the values.

Property Search

Key Bindings

`C-c / p'
     Create a sparse tree based on the value of a property.

`C-c a m'
     Create a global list of tag matches from all agenda files.  *Note
     Matching tags and properties::.

`C-c a M'
     Create a global list of tag matches from all agenda files, but
     check only TODO items and force checking subitems (see variable
     `org-tags-match-list-sublevels').

Syntax

     +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2+With={Sarah\|Denny}

If the comparison value is a plain number, a numerical comparison is
done, and the allowed operators are `<', `=', `>', `<=', `>=', and
`<>'.  If the comparison value is enclosed in double quotes, a string
comparison is done, and the same operators are allowed.  If the
comparison value is enclosed in curly braces, a regexp match is
performed, with `=' meaning that the regexp matches the property value,
and `<>' meaning that it does not match.  So the search string in the
example finds entries tagged `:work:' but not `:boss:', which also have
a priority value `A', a `:Coffee:' property with the value `unlimited',
an `Effort' property that is numerically smaller than 2, and a `:With:'
property that is matched by the regular expression `Sarah\|Denny'.

Property Inheritance

variable

org-use-property-inheritance

hard coded inheritance

   Org mode has a few properties for which inheritance is hard-coded, at
least for the special applications for which they are used:

`COLUMNS'
     The `:COLUMNS:' property defines the format of column view (*note
     Column view::).  It is inherited in the sense that the level where
     a `:COLUMNS:' property is defined is used as the starting point
     for a column view table, independently of the location in the
     subtree from where columns view is turned on.

`CATEGORY'
     For agenda view, a category set through a `:CATEGORY:' property
     applies to the entire subtree.

`ARCHIVE'
     For archiving, the `:ARCHIVE:' property may define the archive
     location for the entire subtree (*note Moving subtrees::).

`LOGGING'
     The LOGGING property may define logging settings for an entry or a
     subtree (*note Tracking TODO state changes::).

Property Column View

Define Column

Per File

     #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO

Per Subtree

     ** Top node for columns view
        :PROPERTIES:
        :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
        :END:

Column Definition Syntax

      %[width]property[(title)][{summary-type}]

Except for the percent sign and the property name, all items are
optional.  The individual parts have the following meaning:

     width           An integer specifying the width of the column in characters.
                     If omitted, the width will be determined automatically.
     property        The property that should be edited in this column.
     (title)         The header text for the column. If omitted, the
                     property name is used.
     {summary-type}  The summary type.  If specified, the column values for
                     parent nodes are computed from the children.
                     Supported summary types are:
                     {+}       Sum numbers in this column.
                     {+;%.1f}  Like `+', but format result with `%.1f'.
                     {$}       Currency, short for `+;%.2f'.
                     {:}       Sum times, HH:MM:SS, plain numbers are hours.
                     {X}       Checkbox status, [X] if all children are [X].
                     {X/}      Checkbox status, [n/m].
                     {X%}      Checkbox status, [n%].
Use Column View

Turn on/off

`C-c C-x C-c'
     Create the column view for the local environment.  This command
     searches the hierarchy, up from point, for a `:COLUMNS:' property
     that defines a format.  When one is found, the column view table
     is established for the entire tree, starting from the entry that
     contains the `:COLUMNS:' property.  If none is found, the format
     is taken from the `#+COLUMNS' line or from the variable
     `org-columns-default-format', and column view is established for
     the current entry and its subtree.

`r'
     Recreate the column view, to include recent changes made in the
     buffer.

`g'
     Same as `r'.

`q'
     Exit column view.

Edit Values

`<left> <right> <up> <down>'
     Move through the column view from field to field.

`S-<left>/<right>'
     Switch to the next/previous allowed value of the field.  For this,
     you have to have specified allowed values for a property.

`1..9,0'
     Directly select the nth allowed value, `0' selects the 10th value.

`n / p'
     Same as `S-<left>/<right>'

`e'
     Edit the property at point.  For the special properties, this will
     invoke the same interface that you normally use to change that
     property.  For example, when editing a TAGS property, the tag
     completion or fast selection interface will pop up.

`C-c C-c'
     When there is a checkbox at point, toggle it.

`v'
     View the full value of this property.  This is useful if the width
     of the column is smaller than that of the value.

`a'
     Edit the list of allowed values for this property.  If the list is
     found in the hierarchy, the modified values is stored there.  If
     no list is found, the new value is stored in the first entry that
     is part of the current column view.

Change the table structure

`< / >'
     Make the column narrower/wider by one character.

`S-M-<right>'
     Insert a new column, to the right of the current column.

`S-M-<left>'
     Delete the current column.

Capture Column View

Wiki comments powered by Disqus