diff --git a/user/app/doom-emacs/config.el b/user/app/doom-emacs/config.el index af1a4a5..ff2a743 100644 --- a/user/app/doom-emacs/config.el +++ b/user/app/doom-emacs/config.el @@ -1202,62 +1202,63 @@ https://github.com/magit/magit/issues/460 (@cpitclaudel)." "q" 'helpful-kill-buffers) ;;;------ helpful configuration ------;;; -(add-load-path! "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-1.10.7") +(add-load-path! "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-1.10.8") +(require 'mu4e) (require 'mu4e-contrib) (require 'mu4e-actions) -(setq mu4e-sent-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Sent"))) -(setq mu4e-drafts-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Drafts"))) -(setq mu4e-trash-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Trash"))) -(setq mu4e-refile-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Archive"))) - -(setq mu4e-index-lazy-check t) -(setq mu4e-index-cleanup t) - -(define-key mu4e-main-mode-map (kbd "") #'doom/leader) -(define-key mu4e-headers-mode-map (kbd "") #'doom/leader) -(define-key mu4e-view-mode-map (kbd "") #'doom/leader) - -(define-key mu4e-main-mode-map (kbd "g g") #'evil-goto-first-line) -(define-key mu4e-main-mode-map (kbd "G") #'evil-goto-line) -(define-key mu4e-main-mode-map (kbd "h") #'evil-backward-char) -(define-key mu4e-main-mode-map (kbd "l") #'evil-forward-char) -(define-key mu4e-main-mode-map (kbd "w") #'evil-forward-word-begin) - -(unbind-key "g" mu4e-headers-mode-map) -(define-key mu4e-headers-mode-map (kbd "g g") #'evil-goto-first-line) -(define-key mu4e-headers-mode-map (kbd "G") #'evil-goto-line) -(define-key mu4e-headers-mode-map (kbd "h") #'evil-backward-char) -(define-key mu4e-headers-mode-map (kbd "l") #'evil-forward-char) -(define-key mu4e-headers-mode-map (kbd "w") #'evil-forward-word-begin) - -(unbind-key "g" mu4e-view-mode-map) -(define-key mu4e-view-mode-map (kbd "g g") #'evil-goto-first-line) -(define-key mu4e-view-mode-map (kbd "G") #'evil-goto-line) -(define-key mu4e-view-mode-map (kbd "h") #'evil-backward-char) -(define-key mu4e-view-mode-map (kbd "l") #'evil-forward-char) -(define-key mu4e-view-mode-map (kbd "w") #'evil-forward-word-begin) - -(map! :map 'mu4e-main-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) -(map! :map 'mu4e-main-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) -(map! :map 'mu4e-main-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) - -(map! :map 'mu4e-headers-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) -(map! :map 'mu4e-headers-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) -(map! :map 'mu4e-headers-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) -(map! :map 'mu4e-headers-mode-map :desc "Next char" :ge "l" #'evil-forward-char) -(map! :map 'mu4e-headers-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index) -(map! :map 'mu4e-headers-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply) -(map! :map 'mu4e-headers-mode-map :desc "Archive message" :ge "e" #'mu4e-headers-mark-for-refile) - -(map! :map 'mu4e-view-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) -(map! :map 'mu4e-view-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) -(map! :map 'mu4e-view-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) -(map! :map 'mu4e-view-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index) -(map! :map 'mu4e-view-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply) -(map! :map 'mu4e-view-mode-map :desc "Archive message" :ge "e" #'mu4e-view-mark-for-refile) - (after! mu4e + (setq mu4e-sent-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Sent"))) + (setq mu4e-drafts-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Drafts"))) + (setq mu4e-trash-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Trash"))) + (setq mu4e-refile-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Archive"))) + + (setq mu4e-index-lazy-check t) + (setq mu4e-index-cleanup t) + + (define-key mu4e-main-mode-map (kbd "") #'doom/leader) + (define-key mu4e-headers-mode-map (kbd "") #'doom/leader) + (define-key mu4e-view-mode-map (kbd "") #'doom/leader) + + (define-key mu4e-main-mode-map (kbd "g g") #'evil-goto-first-line) + (define-key mu4e-main-mode-map (kbd "G") #'evil-goto-line) + (define-key mu4e-main-mode-map (kbd "h") #'evil-backward-char) + (define-key mu4e-main-mode-map (kbd "l") #'evil-forward-char) + (define-key mu4e-main-mode-map (kbd "w") #'evil-forward-word-begin) + + (unbind-key "g" mu4e-headers-mode-map) + (define-key mu4e-headers-mode-map (kbd "g g") #'evil-goto-first-line) + (define-key mu4e-headers-mode-map (kbd "G") #'evil-goto-line) + (define-key mu4e-headers-mode-map (kbd "h") #'evil-backward-char) + (define-key mu4e-headers-mode-map (kbd "l") #'evil-forward-char) + (define-key mu4e-headers-mode-map (kbd "w") #'evil-forward-word-begin) + + (unbind-key "g" mu4e-view-mode-map) + (define-key mu4e-view-mode-map (kbd "g g") #'evil-goto-first-line) + (define-key mu4e-view-mode-map (kbd "G") #'evil-goto-line) + (define-key mu4e-view-mode-map (kbd "h") #'evil-backward-char) + (define-key mu4e-view-mode-map (kbd "l") #'evil-forward-char) + (define-key mu4e-view-mode-map (kbd "w") #'evil-forward-word-begin) + + (map! :map 'mu4e-main-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) + (map! :map 'mu4e-main-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) + (map! :map 'mu4e-main-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) + + (map! :map 'mu4e-headers-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) + (map! :map 'mu4e-headers-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) + (map! :map 'mu4e-headers-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) + (map! :map 'mu4e-headers-mode-map :desc "Next char" :ge "l" #'evil-forward-char) + (map! :map 'mu4e-headers-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index) + (map! :map 'mu4e-headers-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply) + (map! :map 'mu4e-headers-mode-map :desc "Archive message" :ge "e" #'mu4e-headers-mark-for-refile) + + (map! :map 'mu4e-view-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) + (map! :map 'mu4e-view-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) + (map! :map 'mu4e-view-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) + (map! :map 'mu4e-view-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index) + (map! :map 'mu4e-view-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply) + (map! :map 'mu4e-view-mode-map :desc "Archive message" :ge "e" #'mu4e-view-mark-for-refile) + (add-to-list 'mu4e-header-info-custom '(:maildir-folder-no-account . ( :name "Maildir folder without account" ;; long name, as seen in the message-view @@ -1276,6 +1277,10 @@ https://github.com/magit/magit/issues/460 (@cpitclaudel)." (:from-or-to . 20) (:maildir-folder-no-account . 30) (:subject))) + + (add-hook 'mu4e-compose-mode-hook #'(lambda () (auto-save-mode -1))) + (setq mu4e-sent-messages-behavior 'delete) + (setq sendmail-program "~/.nix-profile/bin/msmtp") (setq send-mail-function 'smtpmail-send-it) (setq message-sendmail-f-is-evil t) diff --git a/user/app/doom-emacs/doom.org b/user/app/doom-emacs/doom.org index d54a2ce..0d07f89 100644 --- a/user/app/doom-emacs/doom.org +++ b/user/app/doom-emacs/doom.org @@ -1423,62 +1423,63 @@ I don't have this active right now since it's kinda weird with pgtk... ** mu4e Configuration #+BEGIN_SRC emacs-lisp :tangle config.el ;;;------ helpful configuration ------;;; -(add-load-path! "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-1.10.7") +(add-load-path! "~/.nix-profile/share/emacs/site-lisp/elpa/mu4e-1.10.8") +(require 'mu4e) (require 'mu4e-contrib) (require 'mu4e-actions) -(setq mu4e-sent-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Sent"))) -(setq mu4e-drafts-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Drafts"))) -(setq mu4e-trash-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Trash"))) -(setq mu4e-refile-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Archive"))) - -(setq mu4e-index-lazy-check t) -(setq mu4e-index-cleanup t) - -(define-key mu4e-main-mode-map (kbd "") #'doom/leader) -(define-key mu4e-headers-mode-map (kbd "") #'doom/leader) -(define-key mu4e-view-mode-map (kbd "") #'doom/leader) - -(define-key mu4e-main-mode-map (kbd "g g") #'evil-goto-first-line) -(define-key mu4e-main-mode-map (kbd "G") #'evil-goto-line) -(define-key mu4e-main-mode-map (kbd "h") #'evil-backward-char) -(define-key mu4e-main-mode-map (kbd "l") #'evil-forward-char) -(define-key mu4e-main-mode-map (kbd "w") #'evil-forward-word-begin) - -(unbind-key "g" mu4e-headers-mode-map) -(define-key mu4e-headers-mode-map (kbd "g g") #'evil-goto-first-line) -(define-key mu4e-headers-mode-map (kbd "G") #'evil-goto-line) -(define-key mu4e-headers-mode-map (kbd "h") #'evil-backward-char) -(define-key mu4e-headers-mode-map (kbd "l") #'evil-forward-char) -(define-key mu4e-headers-mode-map (kbd "w") #'evil-forward-word-begin) - -(unbind-key "g" mu4e-view-mode-map) -(define-key mu4e-view-mode-map (kbd "g g") #'evil-goto-first-line) -(define-key mu4e-view-mode-map (kbd "G") #'evil-goto-line) -(define-key mu4e-view-mode-map (kbd "h") #'evil-backward-char) -(define-key mu4e-view-mode-map (kbd "l") #'evil-forward-char) -(define-key mu4e-view-mode-map (kbd "w") #'evil-forward-word-begin) - -(map! :map 'mu4e-main-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) -(map! :map 'mu4e-main-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) -(map! :map 'mu4e-main-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) - -(map! :map 'mu4e-headers-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) -(map! :map 'mu4e-headers-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) -(map! :map 'mu4e-headers-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) -(map! :map 'mu4e-headers-mode-map :desc "Next char" :ge "l" #'evil-forward-char) -(map! :map 'mu4e-headers-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index) -(map! :map 'mu4e-headers-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply) -(map! :map 'mu4e-headers-mode-map :desc "Archive message" :ge "e" #'mu4e-headers-mark-for-refile) - -(map! :map 'mu4e-view-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) -(map! :map 'mu4e-view-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) -(map! :map 'mu4e-view-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) -(map! :map 'mu4e-view-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index) -(map! :map 'mu4e-view-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply) -(map! :map 'mu4e-view-mode-map :desc "Archive message" :ge "e" #'mu4e-view-mark-for-refile) - (after! mu4e + (setq mu4e-sent-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Sent"))) + (setq mu4e-drafts-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Drafts"))) + (setq mu4e-trash-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Trash"))) + (setq mu4e-refile-folder (lambda (msg) (concat "/" (nth 1 (split-string (mu4e-message-field msg :maildir) "/" )) "/Archive"))) + + (setq mu4e-index-lazy-check t) + (setq mu4e-index-cleanup t) + + (define-key mu4e-main-mode-map (kbd "") #'doom/leader) + (define-key mu4e-headers-mode-map (kbd "") #'doom/leader) + (define-key mu4e-view-mode-map (kbd "") #'doom/leader) + + (define-key mu4e-main-mode-map (kbd "g g") #'evil-goto-first-line) + (define-key mu4e-main-mode-map (kbd "G") #'evil-goto-line) + (define-key mu4e-main-mode-map (kbd "h") #'evil-backward-char) + (define-key mu4e-main-mode-map (kbd "l") #'evil-forward-char) + (define-key mu4e-main-mode-map (kbd "w") #'evil-forward-word-begin) + + (unbind-key "g" mu4e-headers-mode-map) + (define-key mu4e-headers-mode-map (kbd "g g") #'evil-goto-first-line) + (define-key mu4e-headers-mode-map (kbd "G") #'evil-goto-line) + (define-key mu4e-headers-mode-map (kbd "h") #'evil-backward-char) + (define-key mu4e-headers-mode-map (kbd "l") #'evil-forward-char) + (define-key mu4e-headers-mode-map (kbd "w") #'evil-forward-word-begin) + + (unbind-key "g" mu4e-view-mode-map) + (define-key mu4e-view-mode-map (kbd "g g") #'evil-goto-first-line) + (define-key mu4e-view-mode-map (kbd "G") #'evil-goto-line) + (define-key mu4e-view-mode-map (kbd "h") #'evil-backward-char) + (define-key mu4e-view-mode-map (kbd "l") #'evil-forward-char) + (define-key mu4e-view-mode-map (kbd "w") #'evil-forward-word-begin) + + (map! :map 'mu4e-main-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) + (map! :map 'mu4e-main-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) + (map! :map 'mu4e-main-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) + + (map! :map 'mu4e-headers-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) + (map! :map 'mu4e-headers-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) + (map! :map 'mu4e-headers-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) + (map! :map 'mu4e-headers-mode-map :desc "Next char" :ge "l" #'evil-forward-char) + (map! :map 'mu4e-headers-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index) + (map! :map 'mu4e-headers-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply) + (map! :map 'mu4e-headers-mode-map :desc "Archive message" :ge "e" #'mu4e-headers-mark-for-refile) + + (map! :map 'mu4e-view-mode-map :desc "Jump to maildir" :ge "J" #'mu4e-search-maildir) + (map! :map 'mu4e-view-mode-map :desc "Next line" :ge "j" #'evil-next-visual-line) + (map! :map 'mu4e-view-mode-map :desc "Prev line" :ge "k" #'evil-previous-visual-line) + (map! :map 'mu4e-view-mode-map :desc "Update mail and index" :ge "U" #'mu4e-update-mail-and-index) + (map! :map 'mu4e-view-mode-map :desc "Compose reply" :ge "r" #'mu4e-compose-reply) + (map! :map 'mu4e-view-mode-map :desc "Archive message" :ge "e" #'mu4e-view-mark-for-refile) + (add-to-list 'mu4e-header-info-custom '(:maildir-folder-no-account . ( :name "Maildir folder without account" ;; long name, as seen in the message-view @@ -1497,6 +1498,10 @@ I don't have this active right now since it's kinda weird with pgtk... (:from-or-to . 20) (:maildir-folder-no-account . 30) (:subject))) + + (add-hook 'mu4e-compose-mode-hook #'(lambda () (auto-save-mode -1))) + (setq mu4e-sent-messages-behavior 'delete) + (setq sendmail-program "~/.nix-profile/bin/msmtp") (setq send-mail-function 'smtpmail-send-it) (setq message-sendmail-f-is-evil t)