Adding mu4e config

This commit is contained in:
Chris Cochrun 2021-02-24 09:18:44 -06:00
parent e6ceb75530
commit 1904deefec
3 changed files with 188 additions and 12 deletions

View file

@ -17,6 +17,7 @@
- [[#fennel][Fennel]] - [[#fennel][Fennel]]
- [[#file-management][File Management]] - [[#file-management][File Management]]
- [[#org-mode][Org Mode]] - [[#org-mode][Org Mode]]
- [[#mu4e][MU4E]]
- [[#calendar][Calendar]] - [[#calendar][Calendar]]
- [[#magit][Magit]] - [[#magit][Magit]]
- [[#eshell][Eshell]] - [[#eshell][Eshell]]
@ -284,7 +285,7 @@ This evil-collection package includes a lot of other evil based things.
"fb" '((find-file ~/org/bibles/) :which-key "find bible book") "fb" '((find-file ~/org/bibles/) :which-key "find bible book")
"fr" '(consult-recent-file :which-key "recent file") "fr" '(consult-recent-file :which-key "recent file")
"fs" '(save-buffer :which-key "save") "fs" '(save-buffer :which-key "save")
"hf" '(helpful-function :which-key "describe-function") "hf" '(helpful-callable :which-key "describe-function")
"hv" '(helpful-variable :which-key "describe-variable") "hv" '(helpful-variable :which-key "describe-variable")
"hk" '(helpful-key :which-key "describe-key") "hk" '(helpful-key :which-key "describe-key")
"hi" '(info :which-key "info manual") "hi" '(info :which-key "info manual")
@ -587,10 +588,10 @@ Part of this config includes some special capture templates for my work as a you
(setq org-capture-templates (setq org-capture-templates
'(("t" "Personal todo" entry '(("t" "Personal todo" entry
(file+headline +org-capture-todo-file "Inbox") (file+headline "todo.org" "Inbox")
"* TODO %^{TODO name}\nSCHEDULED: %T\n%a\n%i%?" :prepend t) "* TODO %^{TODO name}\nSCHEDULED: %T\n%a\n%i%?" :prepend t)
("n" "Personal notes" entry ("n" "Personal notes" entry
(file+headline +org-capture-notes-file "Inbox") (file+headline "notes.org" "Inbox")
"* %u %?\n%i\n%a" :prepend t) "* %u %?\n%i\n%a" :prepend t)
("j" "Journal" entry ("j" "Journal" entry
(file+olp+datetree +org-capture-journal-file) (file+olp+datetree +org-capture-journal-file)
@ -638,9 +639,7 @@ Part of this config includes some special capture templates for my work as a you
(setq org-agenda-files (setq org-agenda-files
'("/home/chris/org/DMPREADME.org" '("/home/chris/org/inbox.org"
"/home/chris/org/DMPTODO.org"
"/home/chris/org/inbox.org"
"/home/chris/org/notes.org" "/home/chris/org/notes.org"
"/home/chris/org/repetition.org" "/home/chris/org/repetition.org"
"/home/chris/org/tasks.org" "/home/chris/org/tasks.org"
@ -980,6 +979,96 @@ If on a:
(org-display-inline-images t t beg end) (org-display-inline-images t t beg end)
t))) t)))
#+end_src #+end_src
** MU4E
#+begin_src emacs-lisp
(use-package mu4e
:ensure nil
:config
(setq mu4e-maildir "~/Maildir"
user-full-name "Chris Cochrun"
mu4e-change-filenames-when-moving t
mu4e-get-mail-command "mbsync -a"
mu4e-update-interval (* 15 60)
mu4e-attachment-dir "/home/chris/Documents/PersonalImportant/attachments")
(setq mu4e-contexts
(list
(make-mu4e-context
:name "office"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/office" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "chris@tfcconnection.org")
(mu4e-sent-folder . "/office/Sent Items/")
(mu4e-drafts-folder . "/office/Drafts")
(mu4e-trash-folder . "/office/Deleted Items")
(mu4e-refile-folder . "/office/Archive")
(smtpmail-smtp-user . "chris@tfcconnection.org")
(mu4e-compose-signature . "---\nChris Cochrun")))
(make-mu4e-context
:name "outlook"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/outlook" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "chris.cochrun@outlook.com")
(mu4e-sent-folder . "/outlook/Sent/")
(mu4e-drafts-folder . "/outlook/Drafts")
(mu4e-trash-folder . "/outlook/Deleted")
(mu4e-refile-folder . "/outlook/Archive")
(smtpmail-smtp-user . "chris.cochrun@outlook.com")
(mu4e-compose-signature . "---\nChris Cochrun")))
(make-mu4e-context
:name "gmail"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "ccochrun21@gmail.com")
(mu4e-sent-folder . "/gmail/[Gmail].Sent Mail/")
(smtpmail-smtp-user . "ccochrun21@gmail.com")
(mu4e-compose-signature . "---\nChris Cochrun")))))
;; Add the ability to send email for o365
(setq message-send-mail-function 'smtpmail-send-it
starttls-use-gnutls t
smtpmail-starttls-credentials '(("smtp.office365.com" 587 nil nil))
smtpmail-auth-credentials
'(("smtp.office365.com" 587 "chris@tfcconnection.org" nil))
smtpmail-default-smtp-server "smtp.office365.com"
smtpmail-smtp-server "smtp.office365.com"
smtpmail-smtp-service 587)
;; shortcuts in the jumplist by pressing "J" in the mu4e buffer
(setq mu4e-maildir-shortcuts
'((:maildir "/office/Archive" :key ?a)
(:maildir "/office/INBOX" :key ?i)
(:maildir "/outlook/INBOX" :key ?l)
(:maildir "/office/Junk Email" :key ?j)
(:maildir "/office/INBOX/Website Forms" :key ?f)
(:maildir "/gmail/INBOX" :key ?g)
(:maildir "/office/Sent Items" :key ?s)))
;; (add-to-list mu4e-headers-actions ("org capture message" . mu4e-org-store-and-capture))
(setq mu4e-bookmarks
'((:name "Unread messages"
:query "flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\""
:key 117)
(:name "Today's messages" :query "date:today..now" :key 116)
(:name "Last 7 days" :query "date:7d..now" :hide-unread t :key 119)
(:name "Messages with images" :query "mime:image/*" :key 112)))
(setq mu4e-mu-binary "/usr/bin/mu")
(mu4e t)
:general
(chris/leader-keys
"om" 'mu4e))
(use-package org-mime
:ensure t)
#+end_src
** Calendar ** Calendar
#+begin_src emacs-lisp #+begin_src emacs-lisp

View file

@ -11,3 +11,4 @@ message hello
12 12
2 2
ls ls
cat /sys/class/power_supply/BAT2/capacity

98
init.el
View file

@ -179,7 +179,7 @@
"fb" '((find-file ~/org/bibles/) :which-key "find bible book") "fb" '((find-file ~/org/bibles/) :which-key "find bible book")
"fr" '(consult-recent-file :which-key "recent file") "fr" '(consult-recent-file :which-key "recent file")
"fs" '(save-buffer :which-key "save") "fs" '(save-buffer :which-key "save")
"hf" '(helpful-function :which-key "describe-function") "hf" '(helpful-callable :which-key "describe-function")
"hv" '(helpful-variable :which-key "describe-variable") "hv" '(helpful-variable :which-key "describe-variable")
"hk" '(helpful-key :which-key "describe-key") "hk" '(helpful-key :which-key "describe-key")
"hi" '(info :which-key "info manual") "hi" '(info :which-key "info manual")
@ -351,10 +351,10 @@ vertically."
(setq org-capture-templates (setq org-capture-templates
'(("t" "Personal todo" entry '(("t" "Personal todo" entry
(file+headline +org-capture-todo-file "Inbox") (file+headline "todo.org" "Inbox")
"* TODO %^{TODO name}\nSCHEDULED: %T\n%a\n%i%?" :prepend t) "* TODO %^{TODO name}\nSCHEDULED: %T\n%a\n%i%?" :prepend t)
("n" "Personal notes" entry ("n" "Personal notes" entry
(file+headline +org-capture-notes-file "Inbox") (file+headline "notes.org" "Inbox")
"* %u %?\n%i\n%a" :prepend t) "* %u %?\n%i\n%a" :prepend t)
("j" "Journal" entry ("j" "Journal" entry
(file+olp+datetree +org-capture-journal-file) (file+olp+datetree +org-capture-journal-file)
@ -402,9 +402,7 @@ vertically."
(setq org-agenda-files (setq org-agenda-files
'("/home/chris/org/DMPREADME.org" '("/home/chris/org/inbox.org"
"/home/chris/org/DMPTODO.org"
"/home/chris/org/inbox.org"
"/home/chris/org/notes.org" "/home/chris/org/notes.org"
"/home/chris/org/repetition.org" "/home/chris/org/repetition.org"
"/home/chris/org/tasks.org" "/home/chris/org/tasks.org"
@ -711,6 +709,94 @@ If on a:
(org-display-inline-images t t beg end) (org-display-inline-images t t beg end)
t))) t)))
(use-package mu4e
:ensure nil
:config
(setq mu4e-maildir "~/Maildir"
user-full-name "Chris Cochrun"
mu4e-change-filenames-when-moving t
mu4e-get-mail-command "mbsync -a"
mu4e-update-interval (* 15 60)
mu4e-attachment-dir "/home/chris/Documents/PersonalImportant/attachments")
(setq mu4e-contexts
(list
(make-mu4e-context
:name "office"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/office" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "chris@tfcconnection.org")
(mu4e-sent-folder . "/office/Sent Items/")
(mu4e-drafts-folder . "/office/Drafts")
(mu4e-trash-folder . "/office/Deleted Items")
(mu4e-refile-folder . "/office/Archive")
(smtpmail-smtp-user . "chris@tfcconnection.org")
(mu4e-compose-signature . "---\nChris Cochrun")))
(make-mu4e-context
:name "outlook"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/outlook" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "chris.cochrun@outlook.com")
(mu4e-sent-folder . "/outlook/Sent/")
(mu4e-drafts-folder . "/outlook/Drafts")
(mu4e-trash-folder . "/outlook/Deleted")
(mu4e-refile-folder . "/outlook/Archive")
(smtpmail-smtp-user . "chris.cochrun@outlook.com")
(mu4e-compose-signature . "---\nChris Cochrun")))
(make-mu4e-context
:name "gmail"
:match-func
(lambda (msg)
(when msg
(string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
:vars '((user-mail-address . "ccochrun21@gmail.com")
(mu4e-sent-folder . "/gmail/[Gmail].Sent Mail/")
(smtpmail-smtp-user . "ccochrun21@gmail.com")
(mu4e-compose-signature . "---\nChris Cochrun")))))
;; Add the ability to send email for o365
(setq message-send-mail-function 'smtpmail-send-it
starttls-use-gnutls t
smtpmail-starttls-credentials '(("smtp.office365.com" 587 nil nil))
smtpmail-auth-credentials
'(("smtp.office365.com" 587 "chris@tfcconnection.org" nil))
smtpmail-default-smtp-server "smtp.office365.com"
smtpmail-smtp-server "smtp.office365.com"
smtpmail-smtp-service 587)
;; shortcuts in the jumplist by pressing "J" in the mu4e buffer
(setq mu4e-maildir-shortcuts
'((:maildir "/office/Archive" :key ?a)
(:maildir "/office/INBOX" :key ?i)
(:maildir "/outlook/INBOX" :key ?l)
(:maildir "/office/Junk Email" :key ?j)
(:maildir "/office/INBOX/Website Forms" :key ?f)
(:maildir "/gmail/INBOX" :key ?g)
(:maildir "/office/Sent Items" :key ?s)))
;; (add-to-list mu4e-headers-actions ("org capture message" . mu4e-org-store-and-capture))
(setq mu4e-bookmarks
'((:name "Unread messages"
:query "flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\""
:key 117)
(:name "Today's messages" :query "date:today..now" :key 116)
(:name "Last 7 days" :query "date:7d..now" :hide-unread t :key 119)
(:name "Messages with images" :query "mime:image/*" :key 112)))
(setq mu4e-mu-binary "/usr/bin/mu")
(mu4e t)
:general
(chris/leader-keys
"om" 'mu4e))
(use-package org-mime
:ensure t)
(use-package calfw (use-package calfw
:commands chris/calfw-calendar-open :commands chris/calfw-calendar-open
:config :config