Set up org-capture, using doctm with some icons :)

This commit is contained in:
tecosaur 2020-04-12 15:00:34 +08:00
parent 18376a8e18
commit 6e357b2665
1 changed files with 161 additions and 0 deletions

View File

@ -457,6 +457,14 @@ The agenda is nice, but a souped up version is nicer.
#+BEGIN_SRC emacs-lisp
(package! org-super-agenda :pin "dd0d104c26")
#+END_SRC
Similarly ~doct~ (Declarative Org Capture Templates) seems to be a nicer way to
set up org-capture.
#+BEGIN_SRC emacs-lisp
(package! doct
:recipe (:host github :repo "progfolio/doct")
:pin "6cf1943ad7")
#+END_SRC
**** Visuals
Org tables aren't the prettiest thing to look at. This package is supposed to
redraw them in the buffer with box-drawing characters. Sounds like an
@ -953,6 +961,159 @@ My spelling is atrocious, so let's get flycheck going.
:order 90)
(:discard (:tag ("Chore" "Routine" "Daily")))))))))))
#+END_SRC
**** Capture
Let's setup some org-capture templates
#+BEGIN_SRC emacs-lisp :noweb yes
(use-package! doct
:commands (doct))
(after! org-capture
(add-transient-hook! 'org-capture-select-template
(setq org-capture-templates
(doct `((,(format "%s\tPersonal todo" (all-the-icons-octicon "checklist" :face 'all-the-icons-green :v-adjust 0.01))
:keys "t"
:file +org-capture-todo-file
:prepend t
:headline "Inbox"
:type entry
:template ("* TODO %?"
"%i %a")
)
(,(format "%s\tPersonal note" (all-the-icons-faicon "sticky-note-o" :face 'all-the-icons-green :v-adjust 0.01))
:keys "n"
:file +org-capture-todo-file
:prepend t
:headline "Inbox"
:type entry
:template ("* %?"
"%i %a")
)
(,(format "%s\tUniversity" (all-the-icons-faicon "graduation-cap" :face 'all-the-icons-purple :v-adjust 0.01))
:keys "u"
:file +org-capture-todo-file
:headline "University"
:prepend t
:type entry
:children ((,(format "%s\tTest" (all-the-icons-material "timer" :face 'all-the-icons-red :v-adjust 0.01))
:keys "t"
:template ("* TODO [#C] %? :uni:tests:"
"SCHEDULED: %^{Test date:}T"
"%i %a"))
(,(format "%s\tAssignment" (all-the-icons-material "library_books" :face 'all-the-icons-orange :v-adjust 0.01))
:keys "a"
:template ("* TODO [#B] %? :uni:assignments:"
"DEADLINE: %^{Due date:}T"
"%i %a"))
(,(format "%s\tMiscellaneous task" (all-the-icons-faicon "list" :face 'all-the-icons-yellow :v-adjust 0.01))
:keys "u"
:template ("* TODO [#C] %? :uni:"
"%i %a"))))
(,(format "%s\tEmail" (all-the-icons-faicon "envelope" :face 'all-the-icons-blue :v-adjust 0.01))
:keys "e"
:file +org-capture-todo-file
:prepend t
:headline "Inbox"
:type entry
:template ("* TODO %? :email:"
"%i %a"))
(,(format "%s\tInteresting" (all-the-icons-faicon "eye" :face 'all-the-icons-lcyan :v-adjust 0.01))
:keys "i"
:file +org-capture-todo-file
:prepend t
:headline "Interesting"
:type entry
:template ("* [ ] %{desc}%? :%{i-type}:"
"%i %a")
:children ((,(format "%s\tWebpage" (all-the-icons-faicon "globe" :face 'all-the-icons-green :v-adjust 0.01))
:keys "w"
:desc "%(org-cliplink-capture) "
:i-type "read:web"
)
(,(format "%s\tArticle" (all-the-icons-octicon "file-text" :face 'all-the-icons-yellow :v-adjust 0.01))
:keys "a"
:desc ""
:i-type "read:reaserch"
)
(,(format "%s\tInformation" (all-the-icons-faicon "info-circle" :face 'all-the-icons-blue :v-adjust 0.01))
:keys "i"
:desc ""
:i-type "read:info"
)
(,(format "%s\tIdea" (all-the-icons-material "bubble_chart" :face 'all-the-icons-silver :v-adjust 0.01))
:keys "I"
:desc ""
:i-type "idea"
)))
(,(format "%s\tTasks" (all-the-icons-octicon "inbox" :face 'all-the-icons-yellow :v-adjust 0.01))
:keys "k"
:file +org-capture-todo-file
:prepend t
:headline "Tasks"
:type entry
:template ("* TODO %? %^G%{extra}"
"%i")
:children ((,(format "%s\tGeneral Task" (all-the-icons-octicon "inbox" :face 'all-the-icons-yellow :v-adjust 0.01))
:keys "k"
:extra ""
)
(,(format "%s\tTask with deadline" (all-the-icons-material "timer" :face 'all-the-icons-orange :v-adjust -0.1))
:keys "d"
:extra "\nDEADLINE: %^{Deadline:}t"
)
(,(format "%s\tScheduled Task" (all-the-icons-octicon "calendar" :face 'all-the-icons-orange :v-adjust 0.01))
:keys "s"
:extra "\nSCHEDULED: %^{Start time:}t"
)
))
(,(format "%s\tProject" (all-the-icons-octicon "repo" :face 'all-the-icons-silver :v-adjust 0.01))
:keys "p"
:prepend t
:type entry
:headline "Inbox"
:template ("* %{time-or-todo} %?"
"%i"
"%a")
:file ""
:custom (:time-or-todo "")
:children ((,(format "%s\tProject-local todo" (all-the-icons-octicon "checklist" :face 'all-the-icons-green :v-adjust 0.01))
:keys "t"
:time-or-todo "TODO"
:file +org-capture-project-todo-file)
(,(format "%s\tProject-local note" (all-the-icons-faicon "sticky-note" :face 'all-the-icons-yellow :v-adjust 0.01))
:keys "n"
:time-or-todo "%U"
:file +org-capture-project-notes-file)
(,(format "%s\tProject-local changelog" (all-the-icons-faicon "list" :face 'all-the-icons-blue :v-adjust 0.01))
:keys "c"
:time-or-todo "%U"
:heading "Unreleased"
:file +org-capture-project-changelog-file))
)
("\tCenteralised project templates"
:keys "o"
:type entry
:prepend t
:template ("* %{time-or-todo} %?"
"%i"
"%a")
:children (("Project todo"
:keys "t"
:prepend nil
:time-or-todo "TODO"
:heading "Tasks"
:file +org-capture-central-project-todo-file)
("Project note"
:keys "n"
:time-or-todo "%U"
:heading "Notes"
:file +org-capture-central-project-notes-file)
("Project changelog"
:keys "c"
:time-or-todo "%U"
:heading "Unreleased"
:file +org-capture-central-project-changelog-file))
))))))
#+END_SRC
**** Nicer headings
Thanks to alphapapa's [[https://github.com/alphapapa/unpackaged.el#export-to-html-with-useful-anchors][unpackaged.el]].
Unfortunately this currently seems to break some of the other modifications I've made.