nixos/home/emacs/doom/config.el

177 lines
7 KiB
EmacsLisp
Raw Normal View History

;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; UTF-8 support
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
(setq user-full-name "Evie Litherland-Smith"
user-mail-address "e.litherlandsmith@proton.me"
2023-10-15 10:46:53 +01:00
doom-font "FiraCode Nerd Font-12"
doom-symbol-fallback-font-families '("Material Icons" "FontAwesome" "Weather Icons")
doom-emoji-fallback-font-families '("Noto Color Emoji" "Noto Emoji")
nerd-icons-font-family "FiraCode Nerd Font"
doom-theme 'doom-tokyo-night
2023-10-15 10:02:16 +01:00
doom-modeline-gnus t
doom-modeline-persp-icon t
doom-modeline-persp-name t
display-line-numbers-type 'relative
org-directory "~/Org/"
+latex-viewers '(pdf-tools)
+format-with-lsp nil)
(+global-word-wrap-mode +1)
2023-10-17 05:12:08 +01:00
(setq-default left-margin-width 1 right-margin-width 1)
(set-window-buffer nil (current-buffer))
2023-10-16 11:16:44 +01:00
(set-frame-parameter nil 'alpha-background 80)
(add-to-list 'default-frame-alist '(alpha-background . 80))
;; DOOM Dashboard customisation
(setq +doom-dashboard-menu-sections
'(("Recently opened files"
:icon (nerd-icons-mdicon "nf-md-file_document" :face 'doom-dashboard-menu-title)
:action recentf-open-files)
("Reload last session"
:icon (nerd-icons-mdicon "nf-md-history" :face 'doom-dashboard-menu-title)
:when (cond ((modulep! :ui workspaces)
(file-exists-p (expand-file-name persp-auto-save-fname persp-save-dir)))
((require 'desktop nil t)
(file-exists-p (desktop-full-file-name))))
:action doom/quickload-session)
("Open org-agenda"
:icon (nerd-icons-mdicon "nf-md-calendar" :face 'doom-dashboard-menu-title)
:when (fboundp 'org-agenda)
:action org-agenda)
("Open project"
:icon (nerd-icons-mdicon "nf-md-briefcase" :face 'doom-dashboard-menu-title)
:action projectile-switch-project)
("Jump to bookmark"
:icon (nerd-icons-mdicon "nf-md-bookmark" :face 'doom-dashboard-menu-title)
:action bookmark-jump)
("Open private configuration"
:icon (nerd-icons-mdicon "nf-md-tools" :face 'doom-dashboard-menu-title)
:when (file-directory-p doom-user-dir)
:action doom/open-private-config)
("Open documentation"
:icon (nerd-icons-mdicon "nf-md-book" :face 'doom-dashboard-menu-title)
:action doom/help)))
2023-10-15 10:02:16 +01:00
(after! gnus
2023-10-15 10:36:28 +01:00
(setq gnus-select-method '(nntp "news.gnus.org")))
2023-10-15 10:02:16 +01:00
;; elfeed RSS sources
2023-10-16 13:52:00 +01:00
;; (after! elfeed
;; (setq elfeed-feeds
;; '("https://systemcrafters.net/rss/news.xml"
;; "https://www.zotero.org/blog/feed/"))
;; (add-hook! 'elfeed-search-mode-hook #'elfeed-update))
;; projectile auto-discover projects
(after! projectile
(setq projectile-auto-discover t
projectile-project-search-path '("~/Projects/")
doom-projectile-cache-purge-non-projects t
+workspaces-switch-project-function 'doom-project-browse
+workspaces-on-switch-project-behavior t))
(after! (magit magit-delta)
(add-hook 'magit-mode-hook (lambda () (magit-delta-mode +1))))
;; mail settings
(after! mu4e
(setq mu4e-get-mail-command "mbsync --pull-new inboxes"
mu4e-update-interval 300
mu4e-sent-messages-behavior 'sent
mu4e-attachment-dir "~/Downloads"
mu4e-change-filenames-when-moving t
mu4e-alert-modeline-formatter 'mu4e-alert-default-mode-line-formatter
sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
(:maildir "/iCloud/Inbox/" :key ?i)
2023-10-15 10:02:16 +01:00
(:maildir "/Outlook/Inbox/" :key ?o)))
(setq mu4e-modeline-all-read '("R:" . "󰑇 ")
mu4e-modeline-all-clear '("C:" . "󰚭 ")
mu4e-modeline-new-items '("N:" . "󰎔 ")
2023-10-11 11:46:50 +01:00
mu4e-modeline-unread-items '("U:" . "󰮒 ")
2023-10-11 14:43:47 +01:00
mu4e-search-full-label '("F" . "󱊖 ")
2023-10-11 11:46:50 +01:00
mu4e-search-hide-label '("H" . "󰘓 ")
mu4e-search-related-label '("R" . "󰌹 ")
mu4e-search-skip-duplicates-label '("D" . "󰆑 ")
mu4e-search-threaded-label'("T" . "󱇫 "))
;; Add accounts with contexts
(set-email-account! "Proton"
'((user-mail-address . "e.litherlandsmith@proton.me")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive"))
t)
(set-email-account! "iCloud"
'((user-mail-address . "e.litherlandsmith@icloud.com")
(mu4e-sent-folder . "/iCloud/Sent")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Trash")
(mu4e-refile-folder . "/iCloud/Archive"))
nil)
2023-10-15 10:02:16 +01:00
(set-email-account! "Outlook"
'((user-mail-address . "evie.litherland-smith@ukaea.uk")
2023-10-15 10:02:16 +01:00
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-trash-folder . "/Outlook/Trash")
(mu4e-refile-folder . "/Outlook/Archive"))
nil)
)
;; Calendar settings
(defun open-calendar-all ()
(interactive)
(cfw:open-calendar-buffer
:contents-sources
(list
(cfw:org-create-source "Green") ; org-agenda source
(cfw:ical-create-source "Personal" "~/.calendar/nextcloud/personal.ics" "Red")
(cfw:ical-create-source "Birthdays" "~/.calendar/nextcloud/contact_birthdays.ics" "Grey")
)))
;; Org-mode settings
(after! org
2023-10-10 11:27:13 +01:00
(setq org-agenda-sticky t)
(setq org-agenda-files '("~/Org/" "~/Org/roam/daily/"))
(setq org-agenda-prefix-format
'((agenda . " %i %-12:c%-12t")
(todo . " %i %-24:c")
(tags . " %i %-24:c")
(search . " %i %-24:c"))))
;; Set org-roam capture templates
(after! org-roam
(setq org-roam-capture-templates
'(("d" "default" plain "%?"
:target (file+head "${slug}.org" "#+title: ${title}\n")))))
2023-10-16 18:09:42 +01:00
;; VTERM settings
(after! vterm
(setq vterm-tramp-shells
'(("ssh" "/bin/bash")
("sshx" "/bin/bash"))))
;; Apheleia settings
(after! apheleia
(setq apheleia-remote-algorithm 'local))
2023-10-16 18:09:42 +01:00
;; TRAMP host specific configs
(after! tramp
(setq tramp-default-method "sshx"
tramp-default-remote-shell "/bin/sh"
tramp-remote-path '(tramp-own-remote-path tramp-default-remote-path)))