Org-Mode: Capture Templates - How to Use Them?

I've started using emacs's org-mode often, and finally I get to configure org-capture.

However, I've found in most places that one can configure different templates by adding the following lines to the .emacs file:

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

Question

  • What is the purpose of using these templates?
  • Could you (please) illustrate their uses with some examples?
1

1 Answer

org-capture lets you save (quickly!) links (in a broad sense) to you work for later reference. For example, say that you work on some TeX file, and you realize that you miss a section. Instead of cutting your workflow, you simply hit M-x org-capture and save a quick note (with a link to the place in the TeX file) in your Get Things Done org-file.

In order to use this feature, you have to define certain files where you want to save those quick notes. For example, for me, the most important file is gtd.org where I accomulate all the todo's. In turn, it is useful to add this file to the agenda list (M-x org-agenda-file-to-front) so you can access easily todo lists.

The templates I use are defined as follows:

(setq org-capture-templates
      (quote (("t" "todo" entry (file (concat org-directory "/gtd.org"))
               "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
              ("n" "note" entry (file (concat org-directory "/gtd.org"))
               "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
              ("j" "Journal" entry (file+datetree (concat org-directory "/diary.org"))
               "* %?\n%U\n" :clock-in t :clock-resume t)
              )))

And I mainly use the t for the todos. In practice, I binded (or maybe it is the default) org-capture to C-c c and then C-c c t opens a buffer where I can edit the todo item. Once I'm done C-c C-c saves the note in the predefined place, and I'm thrown automatically back to the buffer and point in the buffer where I was.

As always: for example C-c means that you have to hit the CONTROC-c combination and similarly M-x means that you have to hit META-x (META is normally ALT).

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest