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
- The key used to invoke the template after calling org-capture
- The description that’ll be shown for the note type
- The type of note
- Target location for where the note should be written to
- The template for the note. This field is not required, every type has a default template
Lets explore some of the capture types.
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
* Target item ** Start writing here # ------ * Target 1 ** Target 2 *** Start writing here
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
The same as
item, but for a check item
- [ ] Start writing here # ------ * Target item - [ ] Start writing here # ------ * Target 1 ** Target 2 - [ ] Start writing here
This is the most basic one, it just adds an empty template by default, just plain text
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