On the last post we learned how to use and do a basic configuration for taking notes using org-capture.

Today we’ll explore capture templates.

If you recall, on the previous article, you can add a new type of note like this

(setq org-capture-templates
      '(
        ("k" "Entry description" entry (file "/path/to/file.org")
         "Template")
        ))

The inner most list represents the note and it has five elements

Key
The key used to invoke the template after calling org-capture
Description
The description that’ll be shown for the note type
Type
The type of note
Target
Target location for where the note should be written to
Template
The template for the note. This field is not required, every type has a default template

Types

Lets explore some of the capture types.

entry

Using entry as the type will add a * section to the target file.

The default template for this type of entry will add a * then a space and the cursor after that.

* Start writing here

If the target is a section or subsection (more on this later), it’ll add the correct amount of *’s.

* Target item
** Start writing here

# ------

* Target 1
** Target 2
*** Start writing here

item

Adds a list item to the target location.

The default template is

- Start writing here

# ------

* Target item
   - Start writing here

# ------

* Target 1
** Target 2
    - Start writing here

checkitem

The same as item, but for a check item

- [ ] Start writing here

# ------

* Target item
   - [ ] Start writing here

# ------

* Target 1
** Target 2
    - [ ] Start writing here

plain

This is the most basic one, it just adds an empty template by default, just plain text

table-line

This one adds a table line on the first table found at the target location.

The default template is empty.

Something very useful about this method is that it’ll open the entire table on the capture buffer, but nothing else, which is very distraction-free.

The actual position of the new row can be defined by passing this two options as the last parameter

  • :prepend
  • :table-line-pos