Add doom-modeline, nerd-icons for dired, completion, etc...

Change some keymaps that didn't need to be hydras into regular keymaps

Misc formatting of module files to be a bit easier to read/understand
This commit is contained in:
Evie Litherland-Smith 2023-10-29 07:00:48 +00:00
parent c70002fb0c
commit 6f04773670
9 changed files with 140 additions and 121 deletions

View file

@ -20,11 +20,13 @@
(global-auto-revert-mode +1) (global-auto-revert-mode +1)
(delete-selection-mode) (delete-selection-mode)
;; define a key to define the word at point. ;; Misc useful keymaps
(keymap-set global-map "M-#" #'dictionary-lookup-definition) (keymap-set global-map "M-#" #'dictionary-lookup-definition)
;; define key to open recent files
(keymap-set global-map "C-c r" #'recentf) (keymap-set global-map "C-c r" #'recentf)
(keymap-set global-map "C-c b" #'ibuffer)
(keymap-set global-map "C-c p p" list-packages)
(keymap-set global-map "C-c p i" package-install)
(keymap-set global-map "C-c p d" package-delete)
;; turn on spell checking, if available. ;; turn on spell checking, if available.
(with-eval-after-load 'ispell (with-eval-after-load 'ispell
@ -32,17 +34,6 @@
(add-hook 'text-mode-hook #'flyspell-mode) (add-hook 'text-mode-hook #'flyspell-mode)
(add-hook 'prog-mode-hook #'flyspell-prog-mode))) (add-hook 'prog-mode-hook #'flyspell-prog-mode)))
;; window movement hydra (TODO)
(when (require 'hydra nil :noerror)
(defhydra window (global-map "C-c w")
"Window movement"
("u" winner-undo)
("r" winner-redo)
("n" windmove-down)
("p" windmove-up)
("b" windmove-left)
("f" windmove-right)))
;; Make shebang (#!) file executable when saved ;; Make shebang (#!) file executable when saved
(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)

View file

@ -1,53 +1,49 @@
(setq mail-user-agent 'notmuch-user-agent (setq sendmail-program (executable-find "msmtp")
sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from") message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail message-send-mail-function #'message-send-mail-with-sendmail
message-kill-buffer-on-exit t message-kill-buffer-on-exit t)
notmuch-search-oldest-first nil
notmuch-show-logo nil
notmuch-hello-thousands-separator ","
notmuch-archive-tags '("+archive" "-inbox")
notmuch-message-headers-visible nil
notmuch-multipart/alternative-discouraged '("text/plain" "multipart/related")
notmuch-show-all-multipart/alternative-parts nil
notmuch-hello-sections '(notmuch-hello-insert-header
notmuch-hello-insert-saved-searches
notmuch-hello-insert-inbox
notmuch-hello-insert-alltags)
notmuch-fcc-dirs '((".*@xenia.me.uk" . "Proton/Sent")
(".*@proton.me" . "Proton/Sent")
(".*@litherlandsmith.slmail.me" . "Proton/Sent")
(".*@icloud.com" . "iCloud/Sent")
(".*@ukaea.uk" . "Outlook/Sent")
(".*@jet.uk" . "Outlook/Sent"))
notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key "i")
(:name "unread" :query "tag:unread AND tag:inbox" :key "u")
(:name "flagged" :query "tag:flagged" :key "f")
(:name "sent" :query "tag:sent" :key "t")
(:name "drafts" :query "tag:draft" :key "d")
(:name "all mail" :query "*" :key "a"))
notmuch-tagging-keys '(("a" notmuch-archive-tags "Archive")
("u" notmuch-show-mark-read-tags "Mark read")
("f" ("+flagged") "Flag")
("s" ("+spam" "-inbox") "Mark as spam")
("d" ("+deleted" "-inbox" "-unread") "Delete"))
notmuch-indicator-args '((:terms "tag:unread AND tag:inbox" :label "󰮒 "))
notmuch-indicator-force-refresh-commands '(notmuch-refresh-this-buffer
notmuch-refresh-all-buffers
notmuch-poll-and-refresh-this-buffer))
(when (require 'notmuch nil :noerror) (when (require 'notmuch nil :noerror)
(require 'notmuch-indicator) (keymap-set global-map "C-c m m" #'notmuch)
(notmuch-indicator-mode +1) (keymap-set global-map "C-c m c" #'notmuch-mua-new-mail)
(when (require 'hydra nil :noerror) (keymap-set global-map "C-c m s" #'notmuch-search)
(defhydra email (global-map "C-c m") (setq mail-user-agent 'notmuch-user-agent
"email" notmuch-search-oldest-first nil
("m" notmuch) notmuch-show-logo nil
("c" notmuch-mua-new-mail) notmuch-hello-thousands-separator ","
("s" notmuch-search) notmuch-archive-tags '("+archive" "-inbox")
("i" (notmuch-search "is:inbox")) notmuch-message-headers-visible nil
("u" (notmuch-search "is:unread AND is:inbox"))))) notmuch-multipart/alternative-discouraged '("text/plain" "multipart/related")
notmuch-show-all-multipart/alternative-parts nil
notmuch-hello-sections '(notmuch-hello-insert-header
notmuch-hello-insert-saved-searches
notmuch-hello-insert-inbox
notmuch-hello-insert-alltags)
notmuch-fcc-dirs '((".*@xenia.me.uk" . "Proton/Sent")
(".*@proton.me" . "Proton/Sent")
(".*@litherlandsmith.slmail.me" . "Proton/Sent")
(".*@icloud.com" . "iCloud/Sent")
(".*@ukaea.uk" . "Outlook/Sent")
(".*@jet.uk" . "Outlook/Sent"))
notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key "i")
(:name "unread" :query "tag:unread AND tag:inbox" :key "u")
(:name "flagged" :query "tag:flagged" :key "f")
(:name "sent" :query "tag:sent" :key "t")
(:name "drafts" :query "tag:draft" :key "d")
(:name "all mail" :query "*" :key "a"))
notmuch-tagging-keys '(("a" notmuch-archive-tags "Archive")
("u" notmuch-show-mark-read-tags "Mark read")
("f" ("+flagged") "Flag")
("s" ("+spam" "-inbox") "Mark as spam")
("d" ("+deleted" "-inbox" "-unread") "Delete")))
(when (require 'notmuch-indicator nil :noerror)
(setq notmuch-indicator-args '((:terms "tag:unread AND tag:inbox" :label "󰮒 "))
notmuch-indicator-force-refresh-commands '(notmuch-refresh-this-buffer
notmuch-refresh-all-buffers
notmuch-poll-and-refresh-this-buffer))
(notmuch-indicator-mode +1)))
(provide 'custom-email-config) (provide 'custom-email-config)

View file

@ -1,9 +1,8 @@
(let ((elfeed-base-directory "~/.elfeed"))
(setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory)
elfeed-enclosure-default-dir (expand-file-name "enclosures" elfeed-base-directory)
rmh-elfeed-org-files (list (expand-file-name "feeds.org" elfeed-base-directory))))
(when (require 'elfeed nil :noerror) (when (require 'elfeed nil :noerror)
(let ((elfeed-base-directory "~/.elfeed"))
(setq elfeed-db-directory (expand-file-name "db" elfeed-base-directory)
elfeed-enclosure-default-dir (expand-file-name "enclosures" elfeed-base-directory)
rmh-elfeed-org-files (list (expand-file-name "feeds.org" elfeed-base-directory))))
(add-hook 'elfeed-search-mode-hook #'elfeed-update) (add-hook 'elfeed-search-mode-hook #'elfeed-update)
(when (require 'elfeed-org nil :noerror) (elfeed-org)) (when (require 'elfeed-org nil :noerror) (elfeed-org))
(when (require 'elfeed-tube nil :noerror) (elfeed-tube-setup))) (when (require 'elfeed-tube nil :noerror) (elfeed-tube-setup)))

View file

@ -1,17 +1,23 @@
(setq direnv-always-show-summary nil (when (require 'aggressive-indent nil :noerror)
apheleia-remote-algorithm 'local) (add-hook 'prog-mode-hook #'aggressive-indent-mode))
(when (require 'aggressive-indent nil :noerror) (add-hook 'prog-mode-hook #'aggressive-indent-mode)) (when (require 'rainbow-delimiters nil :noerror)
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode))
(when (require 'rainbow-delimiters nil :noerror) (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) (when (require 'treesit-aut nil :noerror)
(global-treesit-auto-mode +1))
(when (require 'treesit-aut nil :noerror) (global-treesit-auto-mode +1)) (when (require 'apheleia nil :noerror)
(setq apheleia-remote-algorithm 'local)
(keymap-set global-map "C-c c f" #'apheleia-format-buffer)
(apheleia-global-mode +1))
(when (require 'apheleia nil :noerror) (apheleia-global-mode +1)) (when (require 'eglot nil :noerror)
(eglot-ensure))
(when (require 'eglot nil :noerror) (eglot-ensure)) (when (require 'direnv nil :noerror)
(setq direnv-always-show-summary nil)
(when (require 'direnv nil :noerror) (direnv-mode +1)) (direnv-mode +1))
(when (require 'yasnippet nil :noerror) (when (require 'yasnippet nil :noerror)
(require 'yasnippet-snippets nil :noerror) (require 'yasnippet-snippets nil :noerror)

View file

@ -1,12 +1,13 @@
(setq emms-player-list '(emms-player-mpv)
emms-info-functions '(emms-info-native)
emms-source-file-default-directory "~/Music"
emms-lyrics-dir "~/Music/lyrics")
(when (require 'emms-setup nil :noerror) (when (require 'emms-setup nil :noerror)
(setq emms-player-list '(emms-player-mpv)
emms-info-functions '(emms-info-native)
emms-source-file-default-directory "~/Music"
emms-lyrics-dir "~/Music/lyrics")
(emms-all) (emms-all)
(add-hook 'emms-player-started-hook #'emms-show) (add-hook 'emms-player-started-hook #'emms-show)
(add-hook 'emms-player-paused-hook #'emms-show) (add-hook 'emms-player-paused-hook #'emms-show)
(when (require 'hydra nil :noerror) (when (require 'hydra nil :noerror)
(defhydra emms (global-map "C-c e") (defhydra emms (global-map "C-c e")
"emms" "emms"

View file

@ -16,6 +16,13 @@
org-outline-path-complete-in-steps nil org-outline-path-complete-in-steps nil
org-default-notes-file (expand-file-name "notes.org" org-directory)) org-default-notes-file (expand-file-name "notes.org" org-directory))
(keymap-set global-map "C-c o a" org-agenda)
(keymap-set global-map "C-c o n" org-capture)
(keymap-set global-map "C-c o c" org-goto-calendar)
(keymap-set global-map "C-c o j j" org-journal-new-entry)
(keymap-set global-map "C-c o j n" org-journal-new-date-entry)
(keymap-set global-map "C-c o j s" org-journal-new-scheduled-entry)
(setq org-capture-templates (setq org-capture-templates
'(("n" "Note" entry '(("n" "Note" entry
(file+headline "notes.org" "Inbox") (file+headline "notes.org" "Inbox")
@ -39,14 +46,4 @@
:emptry-lines 1) :emptry-lines 1)
)) ))
(when (require 'hydra nil :noerror)
(defhydra org (global-map "C-c o")
"Org-Mode"
("a" org-agenda)
("n" org-capture)
("c" org-goto-calendar)
("j j" org-journal-new-entry)
("j n" org-journal-new-date-entry)
("j s" org-journal-new-scheduled-entry)))
(provide 'custom-org-config) (provide 'custom-org-config)

View file

@ -4,7 +4,9 @@
(project-find-file "Find file") (project-find-file "Find file")
(project-find-regexp "Find regexp") (project-find-regexp "Find regexp")
(project-find-dir "Find directory") (project-find-dir "Find directory")
(project-eshell "Eshell")) (project-eshell "Eshell")))
magit-clone-default-directory "~/Projects/")
(when (require 'magit nil :noerror)
(setq magit-clone-default-directory "~/Projects/"))
(provide 'custom-project-config) (provide 'custom-project-config)

View file

@ -9,33 +9,7 @@
(setq use-dialog-box nil (setq use-dialog-box nil
display-line-numbers 'relative display-line-numbers 'relative
fill-column 80 fill-column 80)
dashboard-icon-type 'nerd-icons
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-set-navigator t
dashboard-set-init-info t
dashboard-startup-banner 'ascii
dashboard-projects-backend 'project-el
dashboard-projects-switch-function 'project-switch-project
dashboard-projects-show-base t
dashboard-recentf-show-base 'align
dashboard-items '((projects . 5) (agenda . 5) (recents . 5))
dashboard-banner-ascii
(concat " .000000. \n"
" .0. .0. \n"
" .00. .00. \n"
" .000cl. .lc000. \n"
".0 0.\n"
"0. .o0000o. .0\n"
" 00 .0' '0. 00 \n"
" 00 .0 0. 00 \n"
" HHHHH HHHHHHHHHHHH HHHHH \n"
"HHHH HHH HHHHHHHHHHHHHH HHHH\n"
" HHHHHH HHHHHHHHH HHHHHHHH \n"
" HHH HHHH HHHHHHHHH HHHH \n"
" HHH HHHHHH \n"
" HHHHH HH \n"))
(defun my/set-frame-alpha () (set-frame-parameter nil 'alpha-background 80)) (defun my/set-frame-alpha () (set-frame-parameter nil 'alpha-background 80))
@ -46,14 +20,63 @@
(global-word-wrap-whitespace-mode +1) (global-word-wrap-whitespace-mode +1)
(set-frame-parameter nil 'alpha-background 80) (set-frame-parameter nil 'alpha-background 80)
(add-hook 'server-after-make-frame-hook (lambda () (set-frame-parameter nil 'alpha-background 80))) (add-hook 'server-after-make-frame-hook (lambda () (set-frame-parameter nil 'alpha-background 80)))
(when (require 'doom-themes nil :noerror) (load-theme 'doom-tokyo-night t))
(when (require 'doom-themes nil :noerror)
(load-theme 'doom-tokyo-night t))
;; Nerd-Icons modes
(when (require 'nerd-icons-dired nil :noerror)
(add-hook 'dired-mode-hook #'nerd-icons-dired-mode))
(when (require 'nerd-icons-ibuffer nil :noerror)
(add-hook 'ibuffer-mode-hook #'nerd-icons-ibuffer-mode))
(when (require 'nerd-icons-completion nil :noerror)
(nerd-icons-completion-mode)
(when (require 'marginalia nil :noerror)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)))
;; Doom-Modeline
(when (require 'doom-modeline nil :noerror)
(setq doom-modeline-icon t)
(display-battery-mode)
(doom-modeline-mode +1))
;; Dashboard ;; Dashboard
(when (require 'dashboard nil :noerror) (setq initial-buffer-choice 'dashboard-open)) (when (require 'dashboard nil :noerror)
(setq initial-buffer-choice 'dashboard-open
dashboard-icon-type 'nerd-icons
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-set-navigator t
dashboard-set-init-info t
dashboard-startup-banner 'ascii
dashboard-projects-backend 'project-el
dashboard-projects-switch-function 'project-switch-project
dashboard-projects-show-base t
dashboard-recentf-show-base 'align
dashboard-items '((projects . 5) (agenda . 5) (recents . 5))
dashboard-banner-ascii (concat " .000000. \n"
" .0. .0. \n"
" .00. .00. \n"
" .000cl. .lc000. \n"
".0 0.\n"
"0. .o0000o. .0\n"
" 00 .0' '0. 00 \n"
" 00 .0 0. 00 \n"
" HHHHH HHHHHHHHHHHH HHHHH \n"
"HHHH HHH HHHHHHHHHHHHHH HHHH\n"
" HHHHHH HHHHHHHHH HHHHHHHH \n"
" HHH HHHH HHHHHHHHH HHHH \n"
" HHH HHHHHH \n"
" HHHHH HH \n")))
;; Extra minor-modes ;; Extra minor-modes
(when (require 'which-key nil :noerror) (which-key-mode +1)) (when (require 'which-key nil :noerror)
(when (require 'page-break nil :noerror) (global-page-break-lines-mode +1)) (which-key-mode +1))
(when (require 'page-break nil :noerror)
(global-page-break-lines-mode +1))
;;;; Help Buffers ;;;; Help Buffers

View file

@ -60,8 +60,12 @@
# ui-packages # ui-packages
all-the-icons all-the-icons
nerd-icons nerd-icons
nerd-icons-completion
nerd-icons-dired
nerd-icons-ibuffer
page-break-lines page-break-lines
dashboard dashboard
doom-modeline
helpful helpful
which-key which-key
link-hint link-hint