Move all capture templates into their own files
This commit is contained in:
parent
721fccc2ca
commit
45658a0bfa
13 changed files with 68 additions and 21 deletions
|
@ -6,4 +6,5 @@
|
|||
(files
|
||||
"*.el"
|
||||
("snippets" "./snippets/*")
|
||||
("icons" "./icons/*"))
|
||||
("icons" "./icons/*")
|
||||
("capture-templates" "./capture-templates/*"))
|
||||
|
|
2
oni-org/capture-templates/appointment.org
Normal file
2
oni-org/capture-templates/appointment.org
Normal file
|
@ -0,0 +1,2 @@
|
|||
* TODO %i%?
|
||||
%U
|
8
oni-org/capture-templates/clocked/code-note.org
Normal file
8
oni-org/capture-templates/clocked/code-note.org
Normal file
|
@ -0,0 +1,8 @@
|
|||
%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"
|
3
oni-org/capture-templates/clocked/code.org
Normal file
3
oni-org/capture-templates/clocked/code.org
Normal file
|
@ -0,0 +1,3 @@
|
|||
#+BEGIN_EXAMPLE
|
||||
%i
|
||||
#+END_EXAMPLE
|
1
oni-org/capture-templates/clocked/item.org
Normal file
1
oni-org/capture-templates/clocked/item.org
Normal file
|
@ -0,0 +1 @@
|
|||
%i%?
|
1
oni-org/capture-templates/clocked/kill-ring.org
Normal file
1
oni-org/capture-templates/clocked/kill-ring.org
Normal file
|
@ -0,0 +1 @@
|
|||
%c
|
3
oni-org/capture-templates/clocked/note.org
Normal file
3
oni-org/capture-templates/clocked/note.org
Normal file
|
@ -0,0 +1,3 @@
|
|||
%U
|
||||
|
||||
%?
|
9
oni-org/capture-templates/inbox-with-selection.org
Normal file
9
oni-org/capture-templates/inbox-with-selection.org
Normal file
|
@ -0,0 +1,9 @@
|
|||
* %?
|
||||
:PROPERTIES:
|
||||
:CREATED: %U
|
||||
:ORIGIN: %a
|
||||
:END:
|
||||
|
||||
#+begin_quote
|
||||
%i
|
||||
#+end_quote
|
5
oni-org/capture-templates/inbox.org
Normal file
5
oni-org/capture-templates/inbox.org
Normal file
|
@ -0,0 +1,5 @@
|
|||
* %?
|
||||
:PROPERTIES:
|
||||
:CREATED: %U
|
||||
:ORIGIN: %a
|
||||
:END:
|
3
oni-org/capture-templates/journal.org
Normal file
3
oni-org/capture-templates/journal.org
Normal file
|
@ -0,0 +1,3 @@
|
|||
* %<%H:%M:%S>
|
||||
|
||||
%?
|
5
oni-org/capture-templates/reading-note.org
Normal file
5
oni-org/capture-templates/reading-note.org
Normal file
|
@ -0,0 +1,5 @@
|
|||
%?
|
||||
|
||||
#+begin_quote
|
||||
%i
|
||||
#+end_quote
|
4
oni-org/capture-templates/task.org
Normal file
4
oni-org/capture-templates/task.org
Normal file
|
@ -0,0 +1,4 @@
|
|||
* TODO %i%?
|
||||
:PROPERTIES:
|
||||
:CREATED: %U
|
||||
:END:
|
|
@ -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")))))
|
||||
|
|
Loading…
Reference in a new issue