Update some keymaps and move more config into use-package blocks

Separate "C-c o" mega org-mode key map into a couple of flat maps

Move org-agenda, org-roam, calendar settings into associated
use-package expressions
This commit is contained in:
Evie Litherland-Smith 2024-04-19 14:55:46 +01:00
parent 55df9a7293
commit fa3408f3bb

110
init.el
View file

@ -381,11 +381,14 @@ Try `magit-clone-default-directory' if available, fall back to
"~/Projects/"))) "~/Projects/")))
(keymap-global-set "C-c w p" #'my/open-projects-directory) (keymap-global-set "C-c w p" #'my/open-projects-directory)
(setopt calendar-date-style 'iso (use-package calendar
calendar-mark-holidays-flag t :bind (("C-c ." . calendar))
calendar-mark-diary-entries-flag nil :custom
calendar-view-holidays-initially-flag nil (calendar-date-style 'iso)
calendar-view-diary-initially-flag nil) (calendar-mark-holidays-flag t)
(calendar-mark-diary-entries-flag nil)
(calendar-view-holidays-initially-flag nil)
(calendar-view-diary-initially-flag nil))
(use-package appt (use-package appt
:custom :custom
@ -396,9 +399,6 @@ Try `magit-clone-default-directory' if available, fall back to
:init :init
(appt-activate +1)) (appt-activate +1))
(with-eval-after-load 'org
(add-hook 'org-agenda-mode-hook #'org-agenda-to-appt))
(setq inhibit-splash-screen t (setq inhibit-splash-screen t
use-dialog-box nil use-dialog-box nil
minibuffer-follows-selected-frame nil minibuffer-follows-selected-frame nil
@ -442,10 +442,7 @@ Try `magit-clone-default-directory' if available, fall back to
(catppuccin-italic-comments t) (catppuccin-italic-comments t)
(catppuccin-italic-variables nil) (catppuccin-italic-variables nil)
:config :config
(load-theme 'catppuccin t) (load-theme 'catppuccin t))
;; Some custom changes to colour choices.
(set-face-attribute 'org-table nil :foreground (catppuccin-get-color 'overlay2))
(set-face-attribute 'org-block nil :foreground (catppuccin-get-color 'overlay2)))
;; Theme ;; Theme
(use-package modus-themes (use-package modus-themes
@ -672,6 +669,9 @@ Try `magit-clone-default-directory' if available, fall back to
:hook org-mode) :hook org-mode)
(use-package org-refile (use-package org-refile
:after org
:init
(require 'org-agenda)
:custom :custom
(org-outline-path-complete-in-steps nil) (org-outline-path-complete-in-steps nil)
(org-refile-use-outline-path t) (org-refile-use-outline-path t)
@ -684,14 +684,11 @@ Try `magit-clone-default-directory' if available, fall back to
:custom :custom
(org-src-window-setup 'current-window)) (org-src-window-setup 'current-window))
(keymap-global-set "C-c o ." #'calendar)
(keymap-global-set "C-c o a" #'org-agenda)
(use-package org-capture (use-package org-capture
:after org :after org
:bind :bind
(("C-c o n" . org-capture) (("C-c n" . org-capture)
("C-c o l" . org-capture-goto-last-stored)) ("C-c C-n" . org-capture-goto-last-stored))
:custom :custom
(org-capture-templates '(("n" "Note" entry (org-capture-templates '(("n" "Note" entry
(file+datetree "notes.org") (file+datetree "notes.org")
@ -706,14 +703,18 @@ Try `magit-clone-default-directory' if available, fall back to
(use-package org-roam (use-package org-roam
:after org :after org
:bind (("C-c o r i" . org-roam-node-insert) :bind (("C-c r i" . org-roam-node-insert)
("C-c o r f" . org-roam-node-find) ("C-c r f" . org-roam-node-find)
("C-c o r n" . org-roam-capture)) ("C-c r n" . org-roam-capture))
:custom :custom
(org-roam-directory (expand-file-name "roam" org-directory)) (org-roam-directory (expand-file-name "roam" org-directory))
(org-roam-completion-everywhere nil) (org-roam-completion-everywhere nil)
(org-roam-node-display-template (concat "${title:*} " (org-roam-node-display-template (concat "${title:*} "
(propertize "${tags:24}" 'face 'org-tag))) (propertize "${tags:24}" 'face 'org-tag)))
(org-roam-capture-templates '(("d" "default" plain "%?"
:target
(file+head "${slug}.org" "#+title: ${title}\n#+author: %n")
:unnarrowed t)))
:config :config
(mkdir org-roam-directory t) (mkdir org-roam-directory t)
(add-to-list 'display-buffer-alist (add-to-list 'display-buffer-alist
@ -726,48 +727,44 @@ Try `magit-clone-default-directory' if available, fall back to
(no-delete-other-windows . t))))) (no-delete-other-windows . t)))))
(org-roam-db-autosync-mode +1)) (org-roam-db-autosync-mode +1))
(with-eval-after-load 'org-roam (use-package org-agenda
(setq org-roam-capture-templates :after org
'(("d" "default" plain "%?" :bind (("C-c a" . org-agenda))
:target (file+head "${slug}.org" :hook (org-agenda-mode . org-agenda-to-appt)
"#+title: ${title}\n#+author: %n") :custom
:unnarrowed t)))) (org-agenda-span 'week)
(org-agenda-start-on-weekday 1)
(with-eval-after-load 'org-roam (org-agenda-sticky nil)
(setq org-roam-graph-executable "dot" (org-agenda-window-setup 'current-window)
org-roam-graph-filetype "svg")) (org-agenda-tags-column 0)
(org-agenda-diary-file (expand-file-name "calendar/inbox.org" org-directory))
(setq org-agenda-span 'week (org-agenda-include-diary nil)
org-agenda-start-on-weekday 1 (org-agenda-include-deadlines t)
org-agenda-sticky nil (org-agenda-todo-ignore-scheduled 'future)
org-agenda-window-setup 'current-window (org-agenda-todo-ignore-deadlines 'far)
org-agenda-tags-column 0 (org-agenda-prefix-format '((agenda . " %-12:c%?-12t% s")
org-agenda-diary-file (expand-file-name "calendar/inbox.org" org-directory)
org-agenda-include-diary nil
org-agenda-include-deadlines t
org-agenda-todo-ignore-scheduled 'future
org-agenda-todo-ignore-deadlines 'far
org-agenda-prefix-format '((agenda . " %-12:c%?-12t% s")
(todo . " %-12:c") (todo . " %-12:c")
(tags . " %-12:c") (tags . " %-12:c")
(search . " %-12:c"))) (search . " %-12:c")))
(org-agenda-files (list
(setopt org-agenda-files (list
(expand-file-name org-directory) (expand-file-name org-directory)
(expand-file-name "calendar" org-directory) (expand-file-name "calendar" org-directory)
(expand-file-name "journal" org-directory) (expand-file-name "journal" org-directory)
(expand-file-name "projects" org-directory))) (expand-file-name "projects" org-directory))))
(setopt org-icalendar-store-UID t (use-package ox-icalendar
org-icalendar-alarm-time 15 :after org
org-icalendar-include-body t :custom
org-icalendar-include-sexps t (org-icalendar-store-UID t)
org-icalendar-include-todo t (org-icalendar-alarm-time 15)
org-icalendar-combined-name "org-mode" (org-icalendar-include-body t)
org-icalendar-combined-description "Emacs org-mode combined export") (org-icalendar-include-sexps t)
(org-icalendar-include-todo t)
(org-icalendar-combined-name "org-mode")
(org-icalendar-combined-description "Emacs org-mode combined export"))
(use-package org-journal (use-package org-journal
:bind (("C-c o j" . org-journal-new-entry)) :after org
:custom :custom
(org-journal-dir (expand-file-name "journal" org-directory)) (org-journal-dir (expand-file-name "journal" org-directory))
(org-journal-enable-cache t) (org-journal-enable-cache t)
@ -799,7 +796,8 @@ Try `magit-clone-default-directory' if available, fall back to
:hook :hook
(LaTeX-mode . citar-capf-setup) (LaTeX-mode . citar-capf-setup)
(org-mode . citar-capf-setup) (org-mode . citar-capf-setup)
:bind (("C-c o c" . citar-open)) :bind ( :map org-mode-map
("C-c c" . citar-open))
:config :config
(require 'nerd-icons) (require 'nerd-icons)
(require 'citar-embark) (require 'citar-embark)
@ -910,8 +908,8 @@ Try `magit-clone-default-directory' if available, fall back to
(use-package eglot (use-package eglot
:demand :demand
:bind (("C-c c e" . eglot) :bind ( :map prog-mode-map
("C-c c C-e" . eglot-reconnect) ("C-c c e" . eglot)
("C-c c a" . eglot-code-actions) ("C-c c a" . eglot-code-actions)
("C-c c r" . eglot-rename)) ("C-c c r" . eglot-rename))
:hook (((nix-mode :hook (((nix-mode