mirror of
https://github.com/Foltik/dotfiles
synced 2025-03-21 19:22:30 -04:00
Overhaul org-capture templates
This commit is contained in:
parent
c43fdcdcc6
commit
e69b817bfc
@ -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)))
|
(neo-theme (if (display-graphic-p) 'icons 'arrow)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Organization
|
** 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.
|
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]].
|
If the manual is not on your computer, it's [[https://orgmode.org/manual/][here]].
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+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)
|
:mode ("\\.org\\'" . org-mode)
|
||||||
:hook (org-mode . org-indent-mode)
|
:hook (org-mode . org-indent-mode)
|
||||||
|
|
||||||
:init
|
|
||||||
; <el expands to an emacs lisp source block
|
|
||||||
(add-to-list 'org-structure-template-alist
|
|
||||||
'("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))
|
|
||||||
|
|
||||||
:general
|
:general
|
||||||
(foltz-major-def
|
(foltz-major-def
|
||||||
:keymaps 'org-mode-map
|
:keymaps 'org-mode-map
|
||||||
@ -407,8 +483,7 @@ If the manual is not on your computer, it's [[https://orgmode.org/manual/][here]
|
|||||||
"c" 'org-capture
|
"c" 'org-capture
|
||||||
"l" 'org-store-link
|
"l" 'org-store-link
|
||||||
"b" 'org-switchb)
|
"b" 'org-switchb)
|
||||||
|
|
||||||
|
|
||||||
:custom
|
:custom
|
||||||
(org-directory "~/Documents/org")
|
(org-directory "~/Documents/org")
|
||||||
(org-agenda-files '("~/Documents/org/"))
|
(org-agenda-files '("~/Documents/org/"))
|
||||||
@ -417,25 +492,11 @@ If the manual is not on your computer, it's [[https://orgmode.org/manual/][here]
|
|||||||
(org-src-window-setup 'current-window "Edit source code in the current window")
|
(org-src-window-setup 'current-window "Edit source code in the current window")
|
||||||
(org-src-fontify-natively t "Highlight syntax in source blocks")
|
(org-src-fontify-natively t "Highlight syntax in source blocks")
|
||||||
(org-latex-to-pdf-process '("latexmk -f pdf %f") "Use pdflatex for export")
|
(org-latex-to-pdf-process '("latexmk -f pdf %f") "Use pdflatex for export")
|
||||||
(org-capture-templates
|
(org-capture-templates foltz-org-capture-templates)
|
||||||
'(("j" "Journal entry" entry
|
(org-structure-template-alist
|
||||||
(file+olp+datetree "journal.org")
|
(append
|
||||||
("**** Happenings of today"))
|
org-structure-template-alist
|
||||||
("t" "Todo" entry
|
foltz-org-structure-templates)))
|
||||||
(file+olp+datetree "notes.org")
|
|
||||||
"*** TODO %^{Thing to do}\nDEADLINE: %t\n")
|
|
||||||
("T" "Thoughts" entry
|
|
||||||
(file+headline "notes.org" "Thoughts")
|
|
||||||
"** %^{Summary} %t :thoughts:\n")
|
|
||||||
("s" "School-related task" entry
|
|
||||||
(file+datetree+prompt "school.org")
|
|
||||||
"*** TODO %^{What needs be done}\n DEADLINE: %t\n")
|
|
||||||
("d" "Dream Journal" entry
|
|
||||||
(file+olp+datetree "dreams.org")
|
|
||||||
"**** Dream\n")
|
|
||||||
("m" "Bookmark" entry
|
|
||||||
(file+headline "links.org" "Unsorted sites")
|
|
||||||
"[[%^{link}][%^{description}]]\n"))))
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Pretty org-mode bullets
|
*** Pretty org-mode bullets
|
||||||
@ -464,8 +525,11 @@ emacs operations.
|
|||||||
"b" 'ivy-switch-buffer
|
"b" 'ivy-switch-buffer
|
||||||
"v" 'ivy-push-view
|
"v" 'ivy-push-view
|
||||||
"V" 'ivy-pop-view
|
"V" 'ivy-pop-view
|
||||||
"k" 'foltz-kill-curr-buffer
|
"c" 'foltz-kill-curr-buffer
|
||||||
"K" 'foltz-kill-all-buffers)
|
"C" 'foltz-kill-all-buffers)
|
||||||
|
(:keymaps 'org-capture-mode-map
|
||||||
|
:states 'normal
|
||||||
|
"C-c C-w" 'foltz-org-capture-refile)
|
||||||
|
|
||||||
:custom
|
:custom
|
||||||
(ivy-use-virtual-buffers t)
|
(ivy-use-virtual-buffers t)
|
||||||
|
Loading…
Reference in New Issue
Block a user