From e69b817bfcd664a7dd046fca7cdc238c005c57de Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Sat, 27 Oct 2018 01:04:21 -0400 Subject: [PATCH] Overhaul org-capture templates --- lain/.emacs.d/config.org | 122 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 93 insertions(+), 29 deletions(-) diff --git a/lain/.emacs.d/config.org b/lain/.emacs.d/config.org index 758bee3..358dff3 100644 --- a/lain/.emacs.d/config.org +++ b/lain/.emacs.d/config.org @@ -378,7 +378,88 @@ It also needs icon fonts, installed with =M-x all-the-icons-install-fonts= (neo-theme (if (display-graphic-p) 'icons 'arrow))) #+END_SRC ** Organization -*** org-mode +*** Capture Templates +All of my capture templates, from tasks to bookmarks. +**** Refile Targets +Goodize the refiling targets to allow moving to subtrees +#+BEGIN_SRC emacs-lisp +(defun foltz-org-capture-refile () + (interactive) + (setq-local org-refile-targets '((nil :maxlevel . 5))) + (setq-local org-refile-use-outline-path t) + (org-refile)) +#+END_SRC +**** Tasks +#+BEGIN_SRC emacs-lisp +(setq foltz-org-capture-task-templates '( + ("t" "Todo") + ("tg" "General" entry + (file+headline "notes.org" "Todo") + "** %^{todo}\nNotes: %^{notes}\n") + ("tt" "General (Date)" entry + (file+olp+datetree "notes.org") + "*** TODO %^{todo}\nNotes: %^{notes}\nDue: %^t\n") + ("tT" "General (Date+Time)" entry + (file+olp+datetree "notes.org") + "*** TODO %^{todo}\nNotes: %^{notes}\nDue: %^T\n") + ("ts" "School (Date)" entry + (file+olp+datetree "notes.org") + "*** TODO %^{todo}\nClass: %^{class}\nNotes: %^{notes}\nDue: %^t\n") + ("tS" "School (Date+Time)" entry + (file+olp+datetree "notes.org") + "*** TODO %^{todo}\nClass: %^{class}\nDue: %^T\n"))) +#+END_SRC + +**** Bookmarks +#+BEGIN_SRC emacs-lisp +(setq foltz-org-capture-bookmark-templates '( + ("b" "Bookmark" entry + (file+headline "links.org" "Unsorted Links") + "** [[%^{link}][%^{name}]]\nCreated: %U\nAbout: %^{description}\n"))) +#+END_SRC + +**** Personal +#+BEGIN_SRC emacs-lisp +(setq foltz-org-capture-personal-templates '( + ("j" "Journal") + ("jj" "Journal Entry" entry + (file+olp+datetree "journal.org") + "**** Today's Events\n") + ("jt" "Thoughts" entry + (file+headline "notes.org" "Thoughts") + "** %^{summary} %U\n\ + %U\n") + ("jd" "Dream Journal Entry" entry + (file+olp+datetree "dreams.org") + "**** Dream\n"))) +#+END_SRC + +**** All +Tie it all together. +#+BEGIN_SRC emacs-lisp +(setq foltz-org-capture-templates + (append + foltz-org-capture-task-templates + foltz-org-capture-personal-templates + foltz-org-capture-bookmark-templates)) +#+END_SRC +*** Structure Templates +Defines expansions with =<= followed by a string in org-mode. +**** Source Blocks +#+BEGIN_SRC emacs-lisp +(setq foltz-org-source-structure-templates '( + ("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))) +#+END_SRC + +**** All +Tie it all together. +#+BEGIN_SRC emacs-lisp +(setq foltz-org-structure-templates + (append + foltz-org-source-structure-templates)) +#+END_SRC + +*** Org-mode Keep org-mode up to date straight from the cow's utters. If the manual is not on your computer, it's [[https://orgmode.org/manual/][here]]. #+BEGIN_SRC emacs-lisp @@ -387,11 +468,6 @@ If the manual is not on your computer, it's [[https://orgmode.org/manual/][here] :mode ("\\.org\\'" . org-mode) :hook (org-mode . org-indent-mode) - :init - ;