2024-02-15 08:18:41 +00:00
|
|
|
#+title: Org-mode Config
|
|
|
|
#+author: Evie Litherland-Smith
|
|
|
|
#+email: evie@xenia.me.uk
|
|
|
|
#+filetags: :emacs:config:org:
|
2024-02-15 08:45:37 +00:00
|
|
|
#+property: header-args:emacs-lisp :tangle yes :mkdirp yes :results output silent
|
2024-02-15 08:18:41 +00:00
|
|
|
* Org-mode
|
|
|
|
For reference information, see [[https://orgmode.com][Org-mode website]]
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp :results output silent
|
|
|
|
(setq org-directory "~/Documents/Org"
|
|
|
|
org-default-notes-file (expand-file-name "notes.org" org-directory)
|
|
|
|
org-hide-emphasis-markers nil
|
|
|
|
org-pretty-entities-include-sub-superscripts t
|
|
|
|
org-tags-column 0
|
|
|
|
org-outline-path-complete-in-steps nil
|
|
|
|
org-return-follows-link t
|
|
|
|
org-mouse-1-follows-link t
|
|
|
|
org-link-descriptive t
|
|
|
|
org-refile-use-outline-path t
|
|
|
|
org-refile-allow-creating-parent-nodes t
|
|
|
|
org-refile-use-outline-path 'file
|
|
|
|
org-refile-targets '((nil :maxlevel . 2)
|
|
|
|
(org-agenda-files :maxlevel . 1)
|
|
|
|
;; ((expand-file-name "journal" org-directory) :maxlevel . 1)
|
|
|
|
;; ((expand-file-name "roam" org-directory) :maxlevel . 1)
|
|
|
|
(org-agenda-files :tag . "inbox")))
|
|
|
|
|
|
|
|
;; Visually indent org-mode files to a given header level
|
|
|
|
(add-hook 'org-mode-hook #'org-indent-mode)
|
|
|
|
|
|
|
|
(use-package org
|
|
|
|
:ensure t
|
|
|
|
:custom
|
|
|
|
(org-babel-load-languages '((emacs-lisp . t)
|
|
|
|
(python . t))))
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** Keymaps
|
|
|
|
#+begin_src emacs-lisp :results output silent
|
|
|
|
(keymap-global-set "C-c o ." #'calendar)
|
|
|
|
(keymap-global-set "C-c o e" #'org-edit-src-code)
|
|
|
|
(keymap-global-set "C-c o a" #'org-agenda)
|
|
|
|
(keymap-global-set "C-c o n" #'org-capture)
|
|
|
|
(keymap-global-set "C-c o l" #'org-capture-goto-last-stored)
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** org-roam
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package org-roam
|
|
|
|
:ensure t
|
|
|
|
:after org
|
|
|
|
:diminish
|
|
|
|
:bind (("C-c o r i" . org-roam-node-insert)
|
|
|
|
("C-c o r f" . org-roam-node-find)
|
|
|
|
("C-c o r n" . org-roam-capture))
|
|
|
|
:custom
|
|
|
|
(org-roam-directory (expand-file-name "roam" org-directory))
|
|
|
|
(org-roam-node-display-template (concat "${title:*} "
|
|
|
|
(propertize "${tags:10}" 'face 'org-tag)))
|
|
|
|
:config
|
|
|
|
(mkdir org-roam-directory t)
|
|
|
|
(add-to-list 'display-buffer-alist
|
|
|
|
'("\\*org-roam\\*"
|
|
|
|
(display-buffer-in-side-window)
|
|
|
|
(side . right)
|
|
|
|
(slot . 0)
|
|
|
|
(window-width . 0.33)
|
|
|
|
(window-parameters . ((no-other-window . t)
|
|
|
|
(no-delete-other-windows . t)))))
|
|
|
|
(org-roam-db-autosync-mode +1))
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** org-agenda
|
|
|
|
#+begin_src emacs-lisp :results output silent
|
|
|
|
(setq org-agenda-span 'week
|
|
|
|
org-agenda-start-on-weekday 1
|
|
|
|
org-agenda-sticky nil
|
|
|
|
org-agenda-window-setup 'current-window
|
|
|
|
org-agenda-tags-column 0
|
|
|
|
org-agenda-todo-ignore-scheduled 'future
|
|
|
|
org-agenda-todo-ignore-deadlines 'far
|
|
|
|
org-agenda-prefix-format '((agenda . " %-12:c%?-12t% s")
|
|
|
|
(todo . " %-12:c")
|
|
|
|
(tags . " %-12:c")
|
|
|
|
(search . " %-12:c")))
|
|
|
|
|
|
|
|
(let ((agenda-file (expand-file-name ".agenda" org-directory)))
|
|
|
|
(if (file-exists-p agenda-file)
|
|
|
|
(setq org-agenda-files agenda-file)))
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** org-alert
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package org-alert
|
|
|
|
:ensure t
|
|
|
|
:after alert
|
|
|
|
:config
|
|
|
|
(setq org-alert-notification-title "org-mode agenda"
|
|
|
|
org-alert-notify-cutoff 30
|
|
|
|
org-alert-notify-after-event-cutoff 5)
|
|
|
|
(org-alert-enable))
|
|
|
|
#+end_src
|
|
|
|
** org-journal
|
|
|
|
#+begin_src emacs-lisp :results output silent
|
|
|
|
(use-package org-journal
|
|
|
|
:bind (("C-c o j" . org-journal-new-entry))
|
|
|
|
:custom
|
|
|
|
(org-journal-dir (expand-file-name "journal" org-directory))
|
|
|
|
(org-journal-file-type 'monthly)
|
|
|
|
(org-journal-file-format "%Y-%m.org"))
|
|
|
|
#+end_src
|
|
|
|
** Capture templates
|
|
|
|
#+begin_src emacs-lisp :results output silent
|
|
|
|
(setq org-capture-templates
|
|
|
|
'(("n" "Note" entry
|
|
|
|
(file+headline "notes.org" "Inbox")
|
|
|
|
"* %?")
|
|
|
|
("t" "Task" entry
|
|
|
|
(file+headline "tasks.org" "Inbox")
|
|
|
|
"* TODO %?"
|
|
|
|
:prepend t)
|
|
|
|
("r" "Reading List" entry
|
|
|
|
(file+headline "reading.org" "Inbox")
|
|
|
|
"* %?")
|
|
|
|
("m" "Email Workflow")
|
|
|
|
("mf" "Follow Up" entry (file+olp "mail.org" "Follow Up")
|
|
|
|
"* TODO Follow up with %:fromname on %a\nSCHEDULED:%t\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))\n\n%i")
|
|
|
|
("mr" "Read Later" entry (file+olp "mail.org" "Read Later")
|
|
|
|
"* TODO Read %:subject\nSCHEDULED:%t\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))\n\n%a\n\n%i")
|
|
|
|
))
|
|
|
|
#+end_src
|
|
|
|
** org-noter
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package org-noter
|
|
|
|
:ensure t
|
|
|
|
:diminish
|
|
|
|
:after (org doc-view)
|
|
|
|
:commands (org-noter)
|
|
|
|
:custom
|
|
|
|
(org-noter-always-create-frame nil)
|
|
|
|
(org-noter-kill-frame-at-session-end nil)
|
|
|
|
(org-noter-auto-save-last-location t)
|
|
|
|
(org-noter-default-notes-file-names '("notes.org"))
|
|
|
|
(org-noter-doc-property-in-notes t)
|
|
|
|
(org-noter-notes-search-path (list
|
|
|
|
(expand-file-name org-directory)
|
|
|
|
(expand-file-name "~/Documents/References/library/")))
|
|
|
|
(org-noter-prefer-root-as-file-level nil))
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
** Citar
|
|
|
|
#+begin_src emacs-lisp :results output silent
|
|
|
|
(use-package citar
|
|
|
|
:ensure t
|
|
|
|
:diminish
|
|
|
|
:custom
|
|
|
|
(org-cite-global-bibliography '("~/Documents/References/main.bib"))
|
|
|
|
(org-cite-insert-processor 'citar)
|
|
|
|
(org-cite-follow-processor 'citar)
|
|
|
|
(org-cite-activate-processor 'citar)
|
|
|
|
(citar-bibliography org-cite-global-bibliography)
|
|
|
|
(citar-library-paths '("~/Documents/References/library/"))
|
|
|
|
(citar-notes-paths '("~/Documents/References/notes/"))
|
|
|
|
:hook
|
|
|
|
(LaTeX-mode . citar-capf-setup)
|
|
|
|
(org-mode . citar-capf-setup)
|
|
|
|
:bind (("C-c r r" . citar-open)
|
|
|
|
:map org-mode-map :package org
|
|
|
|
("C-c r i" . #'org-cite-insert))
|
|
|
|
:config
|
|
|
|
(defvar citar-indicator-files-icons
|
|
|
|
(citar-indicator-create
|
|
|
|
:symbol (nerd-icons-octicon
|
|
|
|
"nf-oct-file"
|
|
|
|
:face 'nerd-icons-green
|
|
|
|
:v-adjust -0.1)
|
|
|
|
:function #'citar-has-files
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "has:files"))
|
|
|
|
(defvar citar-indicator-links-icons
|
|
|
|
(citar-indicator-create
|
|
|
|
:symbol (nerd-icons-octicon
|
|
|
|
"nf-oct-link"
|
|
|
|
:face 'nerd-icons-orange
|
|
|
|
:v-adjust 0.01)
|
|
|
|
:function #'citar-has-links
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "has:links"))
|
|
|
|
(defvar citar-indicator-notes-icons
|
|
|
|
(citar-indicator-create
|
|
|
|
:symbol (nerd-icons-octicon
|
|
|
|
"nf-oct-note"
|
|
|
|
:face 'nerd-icons-blue
|
|
|
|
:v-adjust -0.3)
|
|
|
|
:function #'citar-has-notes
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "has:notes"))
|
|
|
|
(defvar citar-indicator-cited-icons
|
|
|
|
(citar-indicator-create
|
|
|
|
:symbol (nerd-icons-octicon
|
|
|
|
"nf-oct-circle"
|
|
|
|
:face 'nerd-icon-green)
|
|
|
|
:function #'citar-is-cited
|
|
|
|
:padding " " ; need this because the default padding is too low for these icons
|
|
|
|
:tag "is:cited"))
|
|
|
|
(setq citar-indicators (list citar-indicator-files-icons
|
|
|
|
citar-indicator-links-icons
|
|
|
|
citar-indicator-notes-icons
|
|
|
|
citar-indicator-cited-icons)))
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
*** Citar Embark integration
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package citar-embark
|
|
|
|
:ensure t
|
|
|
|
:diminish
|
|
|
|
:after (citar embark)
|
|
|
|
:config
|
|
|
|
(citar-embark-mode +1))
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
*** LaTeX
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq org-latex-compiler "lualatex")
|
|
|
|
(setq org-preview-latex-default-process 'dvisvgm)
|
|
|
|
#+end_src
|
|
|
|
|