Capture (Org Mode Compact Guide)

Next: Refile and Copy, Up: Capture Refile Archive [Contents]

### 9.1 Capture

Capture lets you quickly store notes with little interruption of your work flow. You can define templates for new entries and associate them with different targets for storing notes.

#### Setting up capture

The following customization sets a default target9 file for notes.

    (setq org-default-notes-file (concat org-directory "/notes.org"))

You may also define a global key for capturing new material (see Activation).

#### Using capture

`M-x org-capture`

  Start a capture process, placing you into a narrowed indirect buffer to edit.

`C-c C-c`

  Once you have finished entering information into the capture buffer, `C-c C-c` returns you to the window configuration before the capture process, so that you can resume your work without further distraction.

`C-c C-w`

  Finalize the capture process by refiling the note to a different place (see Refile and Copy).

`C-c C-k`

  Abort the capture process and return to the previous state.

#### Capture templates

You can use templates for different types of capture items, and for different target locations. Say you would like to use one template to create general TODO entries, and you want to put these entries under the heading ‘`Tasks`’ in your file ‘`~/org/gtd.org`’. Also, a date tree in the file ‘`journal.org`’ should capture journal entries. A possible configuration would look like:

    (setq org-capture-templates
          '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
             "* TODO %?\n  %i\n  %a")
            ("j" "Journal" entry (file+datetree "~/org/journal.org")
             "* %?\nEntered on %U\n  %i\n  %a")))

If you then press `t` from the capture menu, Org will prepare the template for you like this:

    * TODO
      [[file:LINK TO WHERE YOU INITIATED CAPTURE]]

During expansion of the template, special %-escapes10 allow dynamic insertion of content. Here is a small selection of the possibilities, consult the manual for more.

‘`%a`’ | annotation, normally the link created with `org-store-link`
‘`%i`’ | initial content, the region when capture is called with `C-u`
‘`%t`’, ‘`%T`’ | timestamp, date only, or date and time
‘`%u`’, ‘`%U`’ | like above, but inactive timestamps
‘`%?`’ | after completing the template, position point here

#### Footnotes

### (9)

Using capture templates, you get finer control over capture locations. See Capture templates.

### (10)

If you need one of these sequences literally, escape the ‘`%`’ with a backslash.

Next: Refile and Copy, Up: Capture Refile Archive [Contents]