Skip to content

Instantly share code, notes, and snippets.

@paullemmens
Created September 13, 2023 18:35
Show Gist options
  • Save paullemmens/97534220f3dc1ace7fbf17ec96804e7d to your computer and use it in GitHub Desktop.
Save paullemmens/97534220f3dc1ace7fbf17ec96804e7d to your computer and use it in GitHub Desktop.
Org configuration
(use-package! org
:defer t
:init
(setq org-directory "~/Nextcloud/org/"
org-roam-directory org-directory
;; Learned (rx (or "a" "b")) from https://www.brettwitty.net/exocortex.html
org-roam-file-exclude-regexp (rx (or ".attach" "4_archive"))
org-agenda-files (directory-files-recursively org-directory ".org$")
org-default-notes-file "~/Nextcloud/org/todo.org"
)
:config
;; Keeping multiple newlines of emphasized text together:
;; https://emacs.stackexchange.com/a/13828/39252
(setcar (nthcdr 4 org-emphasis-regexp-components) 5) ; default is 1.
(org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components)
(setq! writeroom-mode-line-toggle-position 'mode-line-format
writeroom-width 120
writeroom-mode-line t)
(setq! org-hide-emphasis-markers t
org-pretty-entities t
org-startup-with-inline-images t
;; org-outline-path-complete-in-steps nil
org-refile-allow-creating-parent-nodes 'confirm
org-refile-targets '((nil :maxlevel . 4)
(org-agenda-files :maxlevel . 9)))
;; Simplify the number of todo keywords compared to Doom's default.
(setq! org-todo-keywords
'((sequence
"TODO(t)" ; A task that needs doing & is ready to do
"DOING(g)" ; A task that is in progress
"WAIT(w)" ; Something external is holding up this task
"LOOP(r)" ; A recurring task
"|"
"DONE(d)" ; Task successfully completed
"CANCEL(c)" ; Task was cancelled, aborted or is no longer applicable
"NO(n)") ; Task was not completed (mostly for my outcomes)
)
org-todo-keyword-faces
'(("DOING" . +org-todo-active)
("WAIT" . +org-todo-onhold)
("PROJ" . +org-todo-project)
("NO" . +org-todo-cancel)
("KILL" . +org-todo-cancel)))
(setq org-capture-templates
`(
("j" "new _j_ournal" plain
(file ,(pl--agile-results-cur-month))
(file ,(concat "agile_results_" (format-time-string "%Y") "/day_template.org"))
:jump-to-captured t
:immediate-finish t
:tree-type week
:empty-lines 1
)
("w" "new _w_eek" entry
(file ,(pl--agile-results-cur-month))
(file ,(concat "agile_results_" (format-time-string "%Y") "/week_template.org"))
:immediate-finish t
:jump-to-captured t
:empty-lines 1
)
("m" "new _m_onth" entry
(file ,(pl--agile-results-cur-month))
(file ,(concat "agile_results_" (format-time-string "%Y") "/month_template.org"))
:immediate-finish t
:jump-to-captured t
:tree-type month
:empty-lines 1
)
)
)
:hook
;; In org mode i'm reusing the inherited auto-fill-mode from text-mode and
;; manually extend lines that I don't want broken (Evil: S-j) and then visual
;; fill mode breaks them visually using a slightly larger width than fill-column.
;;
;; (add-hook 'org-mode-hook #'+word-wrap-mode)
;; (remove-hook! 'org-mode-hook #'auto-fill-mode)
(org-mode . writeroom-mode)
(org-mode . +org-pretty-mode)
(org-mode . solaire-mode)
:custom-face
(outline-1 ((t (:weight extra-bold :height 1.3))))
(outline-2 ((t (:weight bold :height 1.2))))
(outline-3 ((t (:weight bold :height 1.1))))
;; (outline-4 ((t (:weight semi-bold :height 1.09))))
(outline-4 ((t (:weight semi-bold :height 1.0))))
;; (outline-5 ((t (:weight semi-bold :height 1.06))))
;; (outline-6 ((t (:weight semi-bold :height 1.03))))
;; (outline-7 ((t (:weight semi-bold :height 1.03))))
;; (outline-8 ((t (:weight semi-bold))))
;; (outline-9 ((t (:weight semi-bold))))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment