diff options
Diffstat (limited to 'oni-org/oni-org.el')
-rw-r--r-- | oni-org/oni-org.el | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index e40402d..249298a 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2020.0921.182555 +;; Version: 2020.0921.184312 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons) ;; This program is free software; you can redistribute it and/or modify @@ -328,6 +328,10 @@ also move point to the start of the heading." (require 'org-capture) +(defconst oni-org-capture-template-directory + (expand-file-name "capture-templates" oni-org-root) + "Directory where the template files for ‘org-capture’ are located.") + (defun oni-org-delete-frame-once () "Run `delete-frame'. @@ -346,45 +350,43 @@ After running it once remove it from `org-capture-after-finalize-hook'." (setq org-capture-templates `(("i" "Inbox" entry (file "") - "* %?\n:PROPERTIES:\n:CREATED: %U\n:ORIGIN: %a\n:END:\n\n") + (file ,(expand-file-name "inbox.org" oni-org-capture-template-directory))) ("I" "Inbox (add selection)" entry (file "") - "* %?\n:PROPERTIES:\n:CREATED: %U\n:ORIGIN: %a\n:END:\n\n#+begin_quote\n%i\n#+end_quote") + (file ,(expand-file-name "inbox-with-selection.org" oni-org-capture-template-directory))) ("t" "Task" entry (file "") - "* TODO %i%?\n :PROPERTIES:\n :CREATED: %U\n :END:") + (file ,(expand-file-name "task.org" oni-org-capture-template-directory))) ("a" "Appointment" entry (file "") - "* TODO %i%?\n %U") + (file ,(expand-file-name "appointment.org" oni-org-capture-template-directory))) ("j" "Journal entry" entry (file+olp+datetree ,(oni-org-expand-to-home "documents/gtd/journal.org")) - "* %<%H:%M:%S>\n %?") + (file ,(expand-file-name "journal.org" oni-org-capture-template-directory))) ("n" "Reading note" item (function oni-org-reading-note) - "%?\n\n#+begin_quote\n%i\n#+end_quote" + (file ,(expand-file-name "reading-note.org" oni-org-capture-template-directory)) :empty-lines 1) ("c" "Add to currently clocked item") ("ca" "Note" plain (clock) - " %U\n\n %?" :empty-lines 1) + (file ,(expand-file-name "clocked/note.org" oni-org-capture-template-directory)) + :empty-lines 1) ("ci" "Item to current clocked task" item (clock) - " %i%?" :empty-lines 1) + (file ,(expand-file-name "clcoked/item.org" oni-org-capture-template-directory)) + :empty-lines 1) ("cc" "Marked code example with notes" plain (clock) - " %U - - File: [[file:%F::%(number-to-string (with-current-buffer (get-buffer (find-file-noselect \"%F\")) (line-number-at-pos (region-beginning))))][%f]] - - %? - - #+BEGIN_SRC %(string-remove-suffix \"-mode\" (symbol-name (with-current-buffer (get-buffer (find-file-noselect \"%F\")) major-mode))) - %i - #+END_SRC" + (file ,(expand-file-name "clocked/code-note.org" oni-org-capture-template-directory)) :empty-lines 1) ("cC" "Marked code example" plain (clock) - " #+BEGIN_EXAMPLE\n %i\n #+END_EXAMPLE" - :immediate-finish t :empty-lines 1) + (file ,(expand-file-name "clocked/code.org" oni-org-capture-template-directory)) + :immediate-finish t + :empty-lines 1) ("ck" "Kill-ring contents" plain (clock) - " %c" :immediate-finish t :empty-lines 1))) + (file ,(expand-file-name "clocked/kill-ring.org" oni-org-capture-template-directory)) + :immediate-finish t + :empty-lines 1))) (setq org-capture-templates-contexts '(("n" ((in-mode . "nov-mode"))))) |