emacs mu4e configuration

Joe Bellus 9 months ago
parent 366bbf4ea6
commit 6eb3df1738

@ -106,11 +106,6 @@ Setup straiGht as an alternative for installing packages.
** Application configuration
Remove all the ugly toolbars and menus.
#+begin_src emacs-lisp
(scroll-bar-mode -1) ; Disable visible scrollbar
(tool-bar-mode -1) ; Disable the toolbar
(tooltip-mode -1) ; Disable tooltips
(set-fringe-mode 10) ; Give some breathing room
(menu-bar-mode -1) ; Disable the menu bar
#+end_src
** Recent Mode
@ -176,18 +171,27 @@ Setup a theme as a baseline
(doom-themes-org-config))
#+end_src
** Fonts & Faces
** Fonts & Faces & Window
Font and face settings for code highlighting.
#+begin_src emacs-lisp
(set-face-attribute 'default nil
:font config/mono-font
:slant 'normal)
(set-face-attribute 'fixed-pitch nil :font config/mono-font)
(set-face-attribute 'variable-pitch nil :font config/proportional-font :weight 'light)
(set-face-attribute 'italic nil :slant 'italic :weight 'normal)
(set-face-attribute 'bold nil :weight 'bold)
(defun fs/setup-apperance (frame)
(if (display-graphic-p frame)
(progn
(set-face-attribute 'default nil
:font config/mono-font
:slant 'normal)
(set-face-attribute 'fixed-pitch nil :font config/mono-font)
(set-face-attribute 'variable-pitch nil :font config/proportional-font :weight 'light)
(set-face-attribute 'italic nil :slant 'italic :weight 'normal)
(set-face-attribute 'bold nil :weight 'bold)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)
(set-fringe-mode 10)
(menu-bar-mode -1))))
(mapc 'fs/setup-apperance (frame-list))
(add-hook 'after-make-frame-functions 'fs/setup-apperance)
#+end_src
** Line numbering
@ -486,7 +490,7 @@ This function sets up the basic org functionality and is called when org is init
"mt" '(:ignore t :which-key "todo")
"mts" '(org-schedule :which-key "add schedule")
"mtd" '(org-schedule :which-key "add deadline")
"mtd" '(org-deadline :which-key "add deadline")
"mtp" '(org-priority :which-key "priority")
"mtt" '(fs/todo-hydra/body :which-key "set state")
@ -525,42 +529,45 @@ Show images on startup and limit width to 800 pixels
Faces for org mode. This function is hooked during initialization.
#+begin_src emacs-lisp
(defun fs/org-font-setup ()
(font-lock-add-keywords
'org-mode
'(("^ *\\([-]\\) "
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
(dolist
(face '((org-level-1 . 1.2)
(org-level-2 . 1.1)
(org-level-3 . 1.05)
(org-level-4 . 1.0)
(org-level-5 . 1.0)
(org-level-6 . 1.0)
(org-level-7 . 1.0)
(org-level-8 . 1.0)))
(set-face-attribute (car face) nil
:font config/proportional-font
:weight 'medium
:height (cdr face)))
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit
'(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-table nil :inherit '(fixed-pitch))
(set-face-attribute 'org-scheduled-today nil :foreground "#FFFFFF" :weight 'bold)
(setq org-ellipsis " ▼")
(set-face-attribute 'org-ellipsis nil :height 0.7)
;; (set-face-attribute 'org-checkbox-statistics-todo nil :inherit 'nano-face-default :weight 'bold :foreground "#81A1C1")
;; (set-face-attribute 'org-link nil :inherit 'nano-face-default :weight 'bold :foreground "#d070b6")
;; (set-face-attribute 'org-todo nil :font config/mono-font :weight 'bold :height 0.8)
;; (set-face-attribute 'org-done nil :font config/mono-font :weight 'bold :height 0.8)
;; (set-face-attribute 'org-meta-line nil :height 0.8)
)
(progn
(font-lock-add-keywords
'org-mode
'(("^ *\\([-]\\) "
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
(dolist
(face '((org-level-1 . 1.2)
(org-level-2 . 1.1)
(org-level-3 . 1.05)
(org-level-4 . 1.0)
(org-level-5 . 1.0)
(org-level-6 . 1.0)
(org-level-7 . 1.0)
(org-level-8 . 1.0)))
(set-face-attribute (car face) nil
:font config/proportional-font
:weight 'medium
:height (cdr face)))
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit
'(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-block nil :background "#230b267734ff")
(set-face-attribute 'org-table nil :inherit '(fixed-pitch))
(set-face-attribute 'org-scheduled-today nil :foreground "#FFFFFF" :weight 'bold)
(setq org-ellipsis " ▼")
(set-face-attribute 'org-ellipsis nil :height 0.7)))
;; (add-hook 'after-make-frame-functions 'fs/org-font-setup)
;; (set-face-attribute 'org-checkbox-statistics-todo nil :inherit 'nano-face-default :weight 'bold :foreground "#81A1C1")
;; (set-face-attribute 'org-link nil :inherit 'nano-face-default :weight 'bold :foreground "#d070b6")
;; (set-face-attribute 'org-todo nil :font config/mono-font :weight 'bold :height 0.8)
;; (set-face-attribute 'org-done nil :font config/mono-font :weight 'bold :height 0.8)
;; (set-face-attribute 'org-meta-line nil :height 0.8)
#+end_src
*** Bullets
@ -593,15 +600,15 @@ Customize the bullets for Org headers to nice symbols. Also use org-autolist to
Initialize org mode with a few small tweaks
#+begin_src emacs-lisp
(use-package org
:hook (org-mode . fs/org-mode-setup)
:config
(setq org-hide-emphasis-markers t)
(setq org-src-preserve-indentation t)
(setq org-confirm-babel-evaluate nil)
(fs/org-font-setup))
:hook (org-mode . fs/org-mode-setup)
:config
(setq org-hide-emphasis-markers t)
(setq org-src-preserve-indentation t)
(setq org-confirm-babel-evaluate nil)
(fs/org-font-setup))
(use-package org-appear
:hook (org-mode . org-appear-mode))
:hook (org-mode . org-appear-mode))
(defun fs/org-mode-visual-fill ()
(setq visual-fill-column-width 110 visual-fill-column-center-text t)
@ -650,13 +657,6 @@ Setup Org plantuml
(setq org-plantuml-jar-path
(expand-file-name "/opt/plantuml/plantuml.jar"))
#+end_src
Darken the background color of source blocks
#+begin_src emacs-lisp
(require 'color)
(set-face-attribute 'org-block nil :background
(color-darken-name
(face-attribute 'default :background) 3))
#+end_src
*** Org Download
Allows dragging and dropping files into emacs
@ -737,6 +737,7 @@ Set path for org-agenda files and log completion times
(setq org-log-done t)
(setq org-enforce-todo-dependencies t)
(setq org-enforce-todo-checkbox-dependencies t)
(setq org-agenda-window-setup 'current-window)
#+end_src
*** Roam
@ -792,14 +793,19 @@ Tweaks for evil mode in org
*** Capture Templates
#+begin_src emacs-lisp
(add-to-list 'org-capture-templates
'("t" "Inbox Task" entry
(file org-default-notes-file)
"* TODO %?" :empty-lines 1))
'("t" "Inbox Task" entry
(file org-default-notes-file)
"* TODO %?" :empty-lines 1))
(add-to-list 'org-capture-templates
'("c" "Code Reference" entry
(file org-default-notes-file)
"* TODO %? :codefix:projects:
'("c" "Code Reference" entry
(file org-default-notes-file)
"* TODO %? :codefix:projects:
[[file:%(org-capture-get :original-file)::%(with-current-buffer (org-capture-get :original-file-nondirectory) (number-to-string (line-number-at-pos)))][%(org-capture-get :original-file-nondirectory):%(with-current-buffer (org-capture-get :original-file-nondirectory) (number-to-string (line-number-at-pos)))]]" :empty-lines 1))
(add-to-list 'org-capture-templates
'("T" "Linked Task" entry (file+headline "" "Inbox Tasks")
"* TODO %?\n %u\n %a"))
#+end_src
*** Org Present
@ -873,10 +879,7 @@ Auto completion setup
(use-package corfu
:init
(global-corfu-mode))
(set-face-attribute 'corfu-default nil :background
(color-darken-name (face-attribute 'default :background) 3))
(corfu-popupinfo-mode)
(set-face-attribute 'corfu-popupinfo nil :height 1.0)
;; A few more useful configurations...
(use-package emacs
@ -974,7 +977,7 @@ Tweaks to kill old DIRED buffers, use tab to open subtrees, and make file sizes
(use-package all-the-icons-dired
:init
(add-hook 'dired-mode-hook 'all-the-icons-dired
(add-hook 'dired-mode-hook 'all-the-icons-dired-mode))
#+end_src
** Mastodon
@ -1398,31 +1401,43 @@ Dot file auto tangle. This will cause any org files within the dotfiles path to
(use-package mu4e
:ensure nil
:load-path "/usr/share/emacs/site-lisp/mu4e/"
:defer 20 ; Wait until 20 seconds after startup
;; :defer 20
:config
;; This is set to 't' to avoid mail syncing issues when using mbsync
(setq mu4e-change-filenames-when-moving t)
(setq mu4e-maildir "~/.mail/fivesigma"
mu4e-attachment-dir "~/Downloads")
(setq mu4e-get-mail-command "mbsync -a"
mu4e-change-filenames-when-moving t
mu4e-update-interval 120
mu4e-sent-folder "/Sent"
mu4e-drafts-folder "/Drafts"
mu4e-trash-folder "/Trash"
mu4e-refile-folder "/Archive"
mu4e--server-props mu4e~server-props
mu4e-maildir-shortcuts
'(("/Inbox" . ?i)
("/Sent" . ?s)
("/Trash" . ?t)
("/Drafts" . ?d)
("/All Mail" . ?a)))
(defalias 'mu4e--maildirs-with-query 'mu4e~maildirs-with-query)
(defalias 'mu4e--longest-of-maildirs-and-bookmarks 'mu4e~longest-of-maildirs-and-bookmarks)
(defalias 'mu4e-search-bookmark 'mu4e-headers-search-bookmark)
;; Refresh mail using isync every 10 minutes
(setq mu4e-update-interval (* 10 60))
(setq mu4e-get-mail-command "mbsync -a")
(setq mu4e-maildir "~/Mail")
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-auth-credentials "~/.authinfo"
smtpmail-smtp-server "127.0.0.1"
smtpmail-stream-type 'starttls
smtpmail-smtp-service 1025)
(setq mu4e-drafts-folder "/[Gmail]/Drafts")
(setq mu4e-sent-folder "/[Gmail]/Sent Mail")
(setq mu4e-refile-folder "/[Gmail]/All Mail")
(setq mu4e-trash-folder "/[Gmail]/Trash")
(add-to-list 'gnutls-trustfiles (expand-file-name "~/.config/protonmail/bridge/cert.pem"))
(setq mu4e-maildir-shortcuts
'(("/Inbox" . ?i)
("/[Gmail]/Sent Mail" . ?s)
("/[Gmail]/Trash" . ?t)
("/[Gmail]/Drafts" . ?d)
("/[Gmail]/All Mail" . ?a))))
(setq shr-color-visible-luminance-min 80)
(with-eval-after-load "mm-decode"
(add-to-list 'mm-discouraged-alternatives "text/html")
(add-to-list 'mm-discouraged-alternatives "text/richtext")))
(setq shr-color-visible-luminance-min 80)
(with-eval-after-load "mm-decode"
(add-to-list 'mm-discouraged-alternatives "text/html")
(add-to-list 'mm-discouraged-alternatives "text/richtext"))))
#+end_src
* HTML Export CSS
@ -1787,3 +1802,5 @@ The local config should be including at ~/.emacs/config.eL

@ -1,27 +1,33 @@
* MBSync Configuration
* TODO MBSync Configuration
#+begin_src conf :tangle ~/.mbsyncrc
IMAPAccount gmail
Host imap.gmail.com
IMAPAccount FiveSigma
Host 127.0.0.1
User joe@5sigma.io
PassCmd "op item get 'Google - Joe' --fields label=password"
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
Port 1143
PassCmd "echo $EMAIL_PASS"
SSLType STARTTLS
SSLVersions TLSv1.2
CertificateFile ~/.config/protonmail/bridge/cert.pem
IMAPStore gmail-remote
Account gmail
IMAPStore fs-remote
Account FiveSigma
MaildirStore gmail-local
Subfolders Verbatim
Path ~/Mail/
Inbox ~/Mail/Inbox
MaildirStore fs-local
Path ~/.mail/fivesigma/
Inbox ~/.mail/fivesigma/INBOX/
SubFolders Verbatim
Channel gmail
MaxMessages 1000
Far :gmail-remote:
Near :gmail-local:
Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" "[Gmail]/Trash"
Channel fs-inbox
Near :fs-remote:
Far :fs-local:
Patterns *
Create Both
SyncState *
Expunge Both
# SyncState *
SyncState ~/.mail/fivesigma/imap-transfer
Group FiveSigma
Channel fs-inbox
#+end_src

@ -11,7 +11,7 @@ HostKeyAlgorithms +ssh-rsa
#+begin_src conf
Host remarkable
Hostname 192.168.1.174
Hostname 192.168.1.140
User root
Port 22

@ -59,7 +59,7 @@ function docker_test() {
** Zoxide
#+begin_src sh
eval "$(zoxide init zsh)"
export EDITOR=nvim
export EDITOR=emacsclient
#+end_src
* Go

Loading…
Cancel
Save