Chapter 10: Capture Templates - Frictionless Note-Taking
Brilliant ideas strike at inconvenient times. You’re mid-conversation, mid-code, mid-commute. You need to capture the thought NOW—before it evaporates—without derailing your current focus.
Enter Org-Mode’s capture system: instant note-taking from anywhere, filed automatically to the right place, with zero friction.
1. The Basic Capture Workflow
Bind a global capture key (add to your config):
(global-set-key (kbd "C-c c") 'org-capture)
Now from anywhere in Emacs:
C-c c- Opens capture menu- Choose template (we’ll define these)
- Type note
C-c C-c- Save and return to what you were doing
The note files automatically to your inbox. You barely broke focus.
2. Your First Capture Template
Add to config:
(setq org-capture-templates '(("t" "TODO" entry (file+headline "~/org/inbox.org" "Tasks") "* TODO %?\n %i\n %a")))
Let’s decode:
"t"- The key to trigger this template"TODO"- Description shown in capture menuentry- Create a new heading(file+headline "~/org/inbox.org" "Tasks")- File location and heading"* TODO %?\n %i\n %a"- The template text
The % symbols are placeholders:
%?- Cursor position after template expands%i- Initial region content (if you selected text before capturing)%a- Link to where you were when you captured
Press C-c c t, type your task, press C-c C-c. Boom. Captured.
3. Template Placeholders: The Full Arsenal
3.1. Position and Content
%?- Cursor position%i- Initial content (selected region)%a- Link to current location%A- Like%a, but only if called from agenda
3.2. Timestamps
%t- Timestamp (date only)%T- Timestamp (date and time)%u- Inactive timestamp (date only)%U- Inactive timestamp (date and time)%^t- Prompt for date%^T- Prompt for date and time
3.3. Context
%f- Current file name%F- Current file name (full path)%n- Your user name%c- Kill ring head (clipboard content)%x- X clipboard content
3.4. Prompts
%^{Prompt}- Prompt for text%^{Prompt|default|choice1|choice2}- Prompt with completion%^g- Prompt for tags%^G- Prompt for tags (with allowed tags completion)
3.5. Special
%l- Link to current location (like%abut no description)%(elisp expression)- Evaluate elisp, insert result
4. Practical Capture Templates
4.1. Quick Task
("t" "Task" entry (file+headline "~/org/inbox.org" "Tasks") "* TODO %?\n %U\n %a")
Creates: #+begin_example
5. TODO Fix the bug I just noticed
#+end_example
5.1. Meeting Notes
("m" "Meeting" entry (file+datetree "~/org/meetings.org") "* %^{Meeting Title}\n %U\n Attendees: %^{Attendees}\n\n %?")
Prompts for title and attendees, files by date:
#+begin_example
6. 2025
6.1. 2025-01 January
6.1.1. 2025-01-15 Wednesday
6.1.1.1. Client kickoff meeting
Attendees: Alice, Bob, Carol
[Your notes here] #+end_example
6.2. Journal Entry
("j" "Journal" entry (file+datetree "~/org/journal.org") "* %U\n %?")
Simple dated entry. Daily journaling made effortless.
6.3. Idea Capture
("i" "Idea" entry (file "~/org/ideas.org") "* %^{Idea Title}\n %U\n %?")
Prompts for title, adds timestamp, positions cursor for details.
6.4. Link Repository
("l" "Link" entry (file+headline "~/org/links.org" "Links") "* %a\n %U\n %?")
Capturing a web article? Link auto-captured with timestamp and space for notes.
6.5. Code TODO
("c" "Code TODO" entry (file+headline "~/org/code-todos.org" "Code Tasks") "* TODO %?\n %a\n %i")
Browsing code, spot something that needs work? Capture it with link to exact location and selected code snippet.
6.6. Email Follow-up
("e" "Email" entry (file+headline "~/org/inbox.org" "Emails") "* TODO Reply to %:from about %:subject\n %a\n %U")
When using Emacs for email, %:from and %:subject pull email metadata. Instant email TODO with link back to message.
7. Advanced Target Locations
7.1. File+Headline
(file+headline "~/org/projects.org" "Project Alpha")
Captures under specific heading.
7.2. File+Olp (Outline Path)
(file+olp "~/org/projects.org" "Work" "Project Alpha" "Tasks")
Captures under Work > Project Alpha > Tasks hierarchy.
7.3. File+Datetree
(file+datetree "~/org/journal.org")
Files by date hierarchy (year > month > day).
7.4. File+Function
(file+function "~/org/inbox.org" my-custom-function)
Custom function determines location. Ultimate flexibility.
7.5. Clock
(clock)
Captures under currently clocked task. Perfect for adding notes while working.
7.6. Current File
(file+headline buffer-file-name "Notes")
Captures in current file. Useful for project-specific captures.
8. Template Types
8.1. Entry (Heading)
entry (file "~/org/inbox.org") "* TODO %?"
Creates a new heading.
8.2. Item (List Item)
item (file+headline "~/org/shopping.org" "Groceries") "- %?"
Creates a list item: #+begin_example
9. Groceries
- Milk
- Eggs
- [Your new item]
#+end_example
9.1. Checkitem (Checkbox)
checkitem (file+headline "~/org/packing.org" "Packing List") "- [ ] %?"
Creates checkbox item.
9.2. Table-line
table-line (file+headline "~/org/habits.org" "Exercise Log") "| %U | %^{Exercise} | %^{Duration} |"
Adds row to table:
#+begin_example
10. Exercise Log
| Date | Exercise | Duration |
|---|---|---|
| Running | 30 min | |
| [Your new entry] |
#+end_example
10.1. Plain Text
plain (file+headline "~/org/notes.org" "Quick Notes") "%?"
Inserts plain text (no heading, no list marker).
11. Template Options
Customize template behavior:
("t" "Task" entry (file+headline "~/org/inbox.org" "Tasks") "* TODO %?\n %U" :empty-lines 1 ; Add blank line after entry :clock-in t ; Start clock when capturing :clock-resume t ; Resume previous clock when done :immediate-finish t ; Don't prompt for editing :jump-to-captured t ; Jump to captured entry when done :kill-buffer t ; Kill capture buffer when done :prepend t ; Insert at beginning of target :unnarrowed t) ; Show full file, not just target
Mix and match options for each template.
12. Multi-Template Menus
Group related templates:
(setq org-capture-templates '(("w" "Work") ("wt" "Work Task" entry (file+headline "~/org/work.org" "Tasks") "* TODO %?") ("wm" "Work Meeting" entry (file+datetree "~/org/work.org") "* %^{Meeting} %U\n %?") ("p" "Personal") ("pt" "Personal Task" entry (file+headline "~/org/personal.org" "Tasks") "* TODO %?") ("pj" "Journal" entry (file+datetree "~/org/journal.org") "* %U\n %?")))
C-c c w shows work options, C-c c p shows personal options.
13. Context-Aware Capture
Use elisp to make templates context-aware:
("t" "Task" entry (file+headline (lambda () (if (string-match "work" (or (buffer-file-name) "")) "~/org/work.org" "~/org/personal.org")) "Tasks") "* TODO %?")
Capturing from work files? Goes to work.org. From personal files? Goes to personal.org.
14. Capture Hooks
Run code before/after capture:
(add-hook 'org-capture-before-finalize-hook
(lambda ()
(save-excursion
(org-back-to-heading)
(org-set-tags ":captured:"))))
Auto-tag all captured items.
Or:
(add-hook 'org-capture-after-finalize-hook
(lambda ()
(shell-command "notify-send 'Org Capture' 'Item captured!'")))
Desktop notification on capture.
15. Aborting Captures
Started capture but changed your mind?
C-c C-k- Kill capture (nothing saved)C-c C-w- Refile instead (save but different location)
16. Capture from Outside Emacs
Want to capture from your browser, terminal, or anywhere?
Install org-protocol and set up browser bookmarklet:
javascript:location.href='org-protocol://capture?template=l&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)
Click bookmarklet → Emacs pops up → capture template → back to browser. Web to Org in seconds.
Or use emacsclient:
#!/bin/bash emacsclient -n "org-protocol://capture?template=t&body=$1"
Terminal to Org.
17. Practical Capture Systems
17.1. The GTD Inbox
(setq org-capture-templates '(("i" "Inbox" entry (file "~/org/inbox.org") "* %?\n %U")))
Everything goes to inbox. Process later. Never lose a thought.
17.2. The Cornell Note-taking System
("n" "Note" entry (file+datetree "~/org/notes.org") "* %^{Topic}\n %U\n\n** Cues\n %?\n\n** Notes\n\n** Summary\n")
Structured note template.
17.3. The Zettelkasten
("z" "Zettel" entry (file "~/org/zettelkasten.org") "* %^{Title}\n :PROPERTIES:\n :ID: %(org-id-uuid)\n :END:\n %U\n\n %?")
Each note gets unique ID for linking.
18. Your Exercise
- Set up basic capture templates (task, note, journal at minimum)
- Bind
C-c cglobally toorg-capture - Practice capturing from different contexts (agenda, code files, etc.)
- Create at least one template with prompts (
%^{...}) - Set up a datetree-based template
- Try capturing with selected text (region)
- Experiment with different template options (
:clock-in,:empty-lines, etc.)
19. The Philosophy of Capture
The best capture system is invisible. You have a thought, press two keys, type briefly, done. Back to work. No context switches, no app switching, no “where should this go?”
Org-Mode’s capture templates remove friction from note-taking. Every thought can be preserved without disrupting flow.
The question isn’t “should I capture this?” It’s “why wouldn’t I?”
20. Next: Code Blocks and Literate Programming
You’ve organized notes, tracked time, captured thoughts. Now let’s add executable code to your documents. Yes, your plain text notes can run programs. Welcome to literate programming with Org-Mode.