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/")))
(keymap-global-set "C-c w p" #'my/open-projects-directory)
(setopt calendar-date-style 'iso
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 calendar
:bind (("C-c ." . calendar))
:custom
(calendar-date-style 'iso)
(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
:custom
@ -396,9 +399,6 @@ Try `magit-clone-default-directory' if available, fall back to
:init
(appt-activate +1))
(with-eval-after-load 'org
(add-hook 'org-agenda-mode-hook #'org-agenda-to-appt))
(setq inhibit-splash-screen t
use-dialog-box 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-variables nil)
:config
(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)))
(load-theme 'catppuccin t))
;; Theme
(use-package modus-themes
@ -672,6 +669,9 @@ Try `magit-clone-default-directory' if available, fall back to
:hook org-mode)
(use-package org-refile
:after org
:init
(require 'org-agenda)
:custom
(org-outline-path-complete-in-steps nil)
(org-refile-use-outline-path t)
@ -684,14 +684,11 @@ Try `magit-clone-default-directory' if available, fall back to
:custom
(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
:after org
:bind
(("C-c o n" . org-capture)
("C-c o l" . org-capture-goto-last-stored))
(("C-c n" . org-capture)
("C-c C-n" . org-capture-goto-last-stored))
:custom
(org-capture-templates '(("n" "Note" entry
(file+datetree "notes.org")
@ -706,14 +703,18 @@ Try `magit-clone-default-directory' if available, fall back to
(use-package org-roam
:after org
: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))
:bind (("C-c r i" . org-roam-node-insert)
("C-c r f" . org-roam-node-find)
("C-c r n" . org-roam-capture))
:custom
(org-roam-directory (expand-file-name "roam" org-directory))
(org-roam-completion-everywhere nil)
(org-roam-node-display-template (concat "${title:*} "
(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
(mkdir org-roam-directory t)
(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)))))
(org-roam-db-autosync-mode +1))
(with-eval-after-load 'org-roam
(setq org-roam-capture-templates
'(("d" "default" plain "%?"
:target (file+head "${slug}.org"
"#+title: ${title}\n#+author: %n")
:unnarrowed t))))
(with-eval-after-load 'org-roam
(setq org-roam-graph-executable "dot"
org-roam-graph-filetype "svg"))
(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-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")
(use-package org-agenda
:after org
:bind (("C-c a" . org-agenda))
:hook (org-agenda-mode . org-agenda-to-appt)
:custom
(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-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")
(tags . " %-12:c")
(search . " %-12:c")))
(setopt org-agenda-files (list
(org-agenda-files (list
(expand-file-name org-directory)
(expand-file-name "calendar" 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
org-icalendar-alarm-time 15
org-icalendar-include-body t
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 ox-icalendar
:after org
:custom
(org-icalendar-store-UID t)
(org-icalendar-alarm-time 15)
(org-icalendar-include-body t)
(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
:bind (("C-c o j" . org-journal-new-entry))
:after org
:custom
(org-journal-dir (expand-file-name "journal" org-directory))
(org-journal-enable-cache t)
@ -799,7 +796,8 @@ Try `magit-clone-default-directory' if available, fall back to
:hook
(LaTeX-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
(require 'nerd-icons)
(require 'citar-embark)
@ -910,8 +908,8 @@ Try `magit-clone-default-directory' if available, fall back to
(use-package eglot
:demand
:bind (("C-c c e" . eglot)
("C-c c C-e" . eglot-reconnect)
:bind ( :map prog-mode-map
("C-c c e" . eglot)
("C-c c a" . eglot-code-actions)
("C-c c r" . eglot-rename))
:hook (((nix-mode