aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@rak.ac>2025-04-06 18:53:18 -0400
committerRyan Kavanagh <rak@rak.ac>2025-04-06 18:53:18 -0400
commitc7f8bff8c155a1931a0c5ec1be5b2a03152cdc4a (patch)
treec37061c7e5ac66ade6b93fb1136065ed78b9e0be
parentUpdate debian known hosts (diff)
parentMajor overhaul emacs (diff)
Merge remote-tracking branch 'refs/remotes/origin/master'HEADmaster
-rw-r--r--.chezmoiremove1
-rw-r--r--dot_config/isyncrc.tmpl (renamed from dot_mbsyncrc.tmpl)28
-rw-r--r--dot_emacs252
3 files changed, 159 insertions, 122 deletions
diff --git a/.chezmoiremove b/.chezmoiremove
index fd1ff69..ff30391 100644
--- a/.chezmoiremove
+++ b/.chezmoiremove
@@ -10,6 +10,7 @@ bin/mutt
.config/systemd/user/borgmatic@tosh.service.wants/backup-email@mail.cs.mcgill.ca.service
.config/systemd/user/default.target.wants/swaybg-random.service
.config/neomutt/news.rc
+.mbsyncrc
.xkb
afs
diff --git a/dot_mbsyncrc.tmpl b/dot_config/isyncrc.tmpl
index 1bfd928..0d4db33 100644
--- a/dot_mbsyncrc.tmpl
+++ b/dot_config/isyncrc.tmpl
@@ -12,13 +12,6 @@ PassCmd "~/bin/mutt_oauth2.py --client-id="08162f7c-0fd2-4200-a84a-f25a4db0b584"
AuthMechs XOAUTH2
TLSType IMAPS
-IMAPAccount mcgill
-Host outlook.office365.com
-User ryan.kavanagh@mail.mcgill.ca
-PassCmd "~/bin/mutt_oauth2.py --client-id="08162f7c-0fd2-4200-a84a-f25a4db0b584" --client-secret="TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82" --encryption-pipe="cat" --decryption-pipe="cat" $XDG_STATE_HOME/xoauth2-tokens/ryan.kavanagh.mail.mcgill.ca"
-AuthMechs XOAUTH2
-TLSType IMAPS
-
IMAPAccount CMU
Host imap.gmail.com
User rkavanag@alumni.cmu.edu
@@ -53,9 +46,6 @@ Account UQAM
IMAPStore queensu-remote
Account queensu
-IMAPStore mcgill-remote
-Account mcgill
-
IMAPStore cmu-remote
Account CMU
@@ -88,11 +78,6 @@ Subfolders Verbatim
Path ~/Maildir/queensu/
Inbox ~/Maildir/queensu/INBOX
-MaildirStore mcgill-maildir
-Subfolders Verbatim
-Path ~/Maildir/mcgill/
-Inbox ~/Maildir/mcgill/INBOX
-
MaildirStore gmail-maildir
Subfolders Verbatim
Path ~/Maildir/gmail/
@@ -108,7 +93,7 @@ Far :uqam-remote:
Near :uqam-maildir:
Create Both
Patterns INBOX
-Expunge Near
+Expunge Both
Sync All
Channel uqam-others
@@ -128,14 +113,6 @@ Expunge Both
Remove Both
Sync All
-Channel mcgill
-Far :mcgill-remote:
-Near :mcgill-maildir:
-Create Near
-Patterns * !Calendar !Calendar/* !Contacts !"Conversation History" !"Deleted Items" !"Flux RSS" !Journal !Notes !Outbox
-Expunge Near
-Sync Pull
-
Channel cmu
Far :cmu-remote:
Near :cmu-maildir:
@@ -164,6 +141,7 @@ Channel rak-misc
Far :rak-remote:
Near :rak-maildir:
Create Both
+Remove Both
Expunge Near
Patterns * !Archive !Virtual !Virtual/* !INBOX !Lists !Lists/*
Sync All
@@ -201,6 +179,7 @@ Channel gmail-others
Far :gmail-remote:
Near :gmail-maildir:
Create Near
+Remove Both
Expunge Near
Pattern * !INBOX !"[Google Mail]/Sent Mail" !"[Google Mail]/Drafts" !"[Google Mail]/Bin" !"[Google Mail]/All Mail"
Sync Pull
@@ -209,6 +188,7 @@ Channel archive-to-gmail
Far :ryan.a.kavanagh.gmail.com:
Near :archive:
Create Both
+Remove Both
Expunge Both
Pattern * !"[Gmail]/All Mail" !"[Gmail]/Important" !"[Gmail]/Spam" !"[Gmail]/Starred" !"[Gmail]/Trash"
Sync All
diff --git a/dot_emacs b/dot_emacs
index b6d199e..b181f0c 100644
--- a/dot_emacs
+++ b/dot_emacs
@@ -26,10 +26,11 @@
:bind ; key bindings
(("C-x a r" . align-regexp))
:config ; executed after package is loaded
- (defadvice ; align-regexp should use spaces.
- align-regexp
- (around align-regexp-with-spaces activate)
+ (defun align-regexp--align-regexp-with-spaces ()
+ "Never use tabs for alignment."
(let ((indent-tabs-mode nil)) ad-do-it))
+ (advice-add 'align-regexp--align-regexp-with-spaces
+ :around #'align-regexp-with-spaces)
:custom
(inhibit-startup-screen t)
(default-input-method "TeX")
@@ -37,6 +38,15 @@
(user-mail-address "rak@rak.ac")
(mail-user-agent 'mu4e-user-agent)
(read-mail-command 'mu4e)
+ ;; Support opening new minibuffers from inside existing minibuffers.
+ (enable-recursive-minibuffers t)
+ ;; Hide commands in M-x which do not work in the current mode. Vertico
+ ;; commands are hidden in normal buffers. This setting is useful beyond
+ ;; Vertico.
+ (read-extended-command-predicate #'command-completion-default-include-p)
+ ;; Do not allow the cursor in the minibuffer prompt
+ (minibuffer-prompt-properties
+ '(read-only t cursor-intangible t face minibuffer-prompt))
:custom-face
(default ((t (:family "Iosevka")))))
@@ -62,18 +72,18 @@
;; need to redefine a few of these because the defaults
;; overlap with customized aw-keys
(setq aw-dispatch-alist
- '((?x aw-delete-window "Delete Window")
- (?m aw-swap-window "Swap Windows")
- (?M aw-move-window "Move Window")
- (?c aw-copy-window "Copy Window")
- (?j aw-switch-buffer-in-window "Select Buffer")
- (?f aw-flip-window)
- (?p aw-switch-buffer-other-window "Switch Buffer Other Window")
- (?c aw-split-window-fair "Split Fair Window")
- (?v aw-split-window-vert "Split Vert Window")
- (?b aw-split-window-horz "Split Horz Window")
- (?1 delete-other-windows "Delete Other Windows")
- (?? aw-show-dispatch-help))))
+ '((?x aw-delete-window "Delete Window")
+ (?m aw-swap-window "Swap Windows")
+ (?M aw-move-window "Move Window")
+ (?c aw-copy-window "Copy Window")
+ (?j aw-switch-buffer-in-window "Select Buffer")
+ (?f aw-flip-window)
+ (?p aw-switch-buffer-other-window "Switch Buffer Other Window")
+ (?c aw-split-window-fair "Split Fair Window")
+ (?v aw-split-window-vert "Split Vert Window")
+ (?b aw-split-window-horz "Split Horz Window")
+ (?1 delete-other-windows "Delete Other Windows")
+ (?? aw-show-dispatch-help))))
(use-package aggressive-indent
:ensure t
@@ -219,64 +229,70 @@ Extended Format date in the date field and return it as a string obeing
(bibtex-completion-notes-extension ".org")
(bibtex-completion-pdf-extension '(".pdf" ".djvu" ".txt")))
-(use-package cc-mode
- :custom
- (c-default-style "bsd"))
-
-(use-package company
+(use-package cape
:ensure t
- :diminish
- :bind
- ("<tab>" . company-indent-or-complete-common)
+ ;; Bind prefix keymap providing all Cape commands under a mnemonic key.
+ ;; Press C-c p ? to for help.
+ :bind ("C-c p" . cape-prefix-map) ;; Alternative key: M-<tab>, M-p, M-+
+ ;; Alternatively bind Cape commands individually.
+ ;; :bind (("C-c p d" . cape-dabbrev)
+ ;; ("C-c p h" . cape-history)
+ ;; ("C-c p f" . cape-file)
+ ;; ...)
:hook
- (after-init . global-company-mode))
+ (completion-at-point-functions . cape-dabbrev)
+ (completion-at-point-functions . cape-file)
+ (completion-at-point-functions . cape-elisp-block)
+ (completion-at-point-functions .cape-keyword))
-(use-package company-auctex
- :ensure t
- :after latex
- :config
- (company-auctex-init))
+(use-package cc-mode
+ :custom
+ (c-default-style "bsd"))
(use-package company-bibtex
:ensure t
:hook
(bibtex-mode . (lambda () (add-to-list 'company-backends 'company-bibtex))))
-(use-package company-box
- :ensure t
- :diminish
- :hook (company-mode . company-box-mode))
-
(use-package company-coq
:ensure t
:hook (coq-mode . company-coq-mode))
-(use-package company-math
+(use-package consult
:ensure t
- :config
- (add-to-list 'company-backends 'company-math-symbols-unicode)
- (add-to-list 'company-backends 'company-latex-commands))
-
-(use-package company-org-block
- :ensure t
- :hook ((org-mode . (lambda ()
- (setq-local company-backends '(company-org-block))
- (company-mode +1)))))
+ :bind
+ (("C-x b" . consult-buffer)
+ ("C-x C-f" . find-file)
+ ("C-s" . consult-line)
+ ("M-x" . execute-extended-command)))
-(use-package counsel
+(use-package consult-mu
+ :after (consult mu4e)
+ :bind
+ :custom
+ ;;maximum number of results shown in minibuffer
+ (consult-mu-maxnum 200)
+ ;;show preview when pressing any keys
+ (consult-mu-preview-key 'any)
+ ;;do not mark email as read when previewed
+ (consult-mu-mark-previewed-as-read nil)
+ ;;do not amrk email as read when selected. This is a good starting point to ensure you would not miss important emails marked as read by mistake especially when trying this package out. Later you can change this to t.
+ (consult-mu-mark-viewed-as-read nil)
+ ;; open the message in mu4e-view-buffer when selected.
+ (consult-mu-action #'consult-mu--view-action))
+
+(use-package consult-mu-compose)
+(use-package consult-mu-contacts)
+(setq consult-mu-compose-preview-key "M-o")
+(setq consult-mu-embark-attach-file-key "C-a")
+
+(use-package corfu
:ensure t
:bind
- (("C-x b" . counsel-switch-buffer)
- ("C-x C-b" . counsel-ibuffer)
- ("C-x C-f" . counsel-find-file)
- ("M-x" . counsel-M-x)
- ("M-y" . counsel-yank-pop)
- ("<f2> i" . counsel-info-lookup-symbol)
- ("<f2> j" . counsel-set-variable)
- ("<f2> u" . counsel-unicode-char))
- :config
- (add-to-list 'ivy-initial-inputs-alist
- '(counsel-M-x . "")))
+ (:map corfu-map
+ ("SPC" . corfu-insert-separator))
+ :init
+ (global-corfu-mode))
(use-package csv-mode
:ensure t)
@@ -285,6 +301,19 @@ Extended Format date in the date field and return it as a string obeing
:custom
(custom-file null-device "Don't store customizations"))
+;; Use Dabbrev with Corfu!
+(use-package dabbrev
+ :ensure t
+ ;; Swap M-/ and C-M-/
+ :bind (("M-/" . dabbrev-completion)
+ ("C-M-/" . dabbrev-expand))
+ :config
+ (add-to-list 'dabbrev-ignored-buffer-regexps "\\` ")
+ ;; Since 29.1, use `dabbrev-ignored-buffer-regexps' on older.
+ (add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode)
+ (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode)
+ (add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode))
+
(use-package diary
:ensure diary-lib
:custom
@@ -323,6 +352,17 @@ Extended Format date in the date field and return it as a string obeing
:custom
(elpy-rpc-python-command "python3"))
+(use-package embark
+ :ensure t
+ :bind
+ (("C-." . embark-act) ;; Begin the embark process
+ ("C-;" . embark-dwim) ;; good alternative: M-.
+ ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings'
+ )
+
+(use-package embark-consult
+ :ensure t)
+
(use-package ess
:ensure t)
@@ -349,13 +389,11 @@ Extended Format date in the date field and return it as a string obeing
:config
(unbind-key "C-;" flyspell-mode-map))
-(use-package flyspell-correct-ivy
- :ensure t
+(use-package flyspell-correct
:after flyspell
:bind
- ("C-<f12>" . flyspell-correct-wrapper)
- :config
- (setq flyspell-correct-interface #'flyspell-correct-ivy))
+ (:map flyspell-mode-map
+ ("C-;" . flyspell-correct-wrapper)))
(use-package gnus
:ensure t
@@ -421,19 +459,6 @@ Extended Format date in the date field and return it as a string obeing
:custom
(ispell-dictionary "en_CA-w_accents"))
-(use-package ivy
- :ensure t
- :diminish
- :bind
- (("C-c v" . ivy-push-view)
- ("C-c V" . ivy-pop-view)
- ("C-c C-r" . ivy-resume))
- :custom
- (ivy-use-virtual-buffers t)
- (ivy-count-format "(%d/%d) ")
- :config
- (ivy-mode 1))
-
(use-package ivy-bibtex
:ensure t
:bind (("C-c b" . ivy-bibtex)))
@@ -513,10 +538,16 @@ Otherwise split the current paragraph into one sentence per line."
(:map LaTeX-mode-map
("M-q" . ales/fill-paragraph)))
-(use-package libmpdel
- ;; used by mpdel to connect to mpd
+(use-package lsp-mode
+ :ensure t
:custom
- (libmpdel-hostname "asteria.home.arpa"))
+ (lsp-completion-provider :none) ;; we use Corfu!
+ :init
+ (defun my/lsp-mode-setup-completion ()
+ (setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
+ '(orderless))) ;; Configure orderless
+ :hook
+ (lsp-completion-mode . my/lsp-mode-setup-completion))
(use-package magit
:ensure t
@@ -525,6 +556,13 @@ Otherwise split the current paragraph into one sentence per line."
:custom
(magit-diff-refine-hunk 'all))
+(use-package marginalia
+ :ensure t
+ :bind (:map minibuffer-local-map
+ ("M-A" . marginalia-cycle))
+ :init
+ (marginalia-mode))
+
(use-package markdown-mode
:ensure t
:init
@@ -570,14 +608,6 @@ Otherwise split the current paragraph into one sentence per line."
:custom
(mpc-host "asteria.home.arpa"))
-(use-package mpdel
- ;; mpd client
- ;; host/port customization under libmpdel package
- :ensure t
- :diminish
- :config
- (mpdel-mode))
-
(use-package mu4e
:ensure t
:bind
@@ -691,6 +721,10 @@ Otherwise split the current paragraph into one sentence per line."
;; compose messages in new frame
(mu4e-compose-in-new-frame t)
+ ;; use default emacs completion
+ (mu4e-read-option-use-builtin nil)
+ (mu4e-completing-read-function 'completing-read)
+
;; hide long list off addresses from main view and silence warnings
;; about mu4e not recognizing user-mail-address against regexp
(mu4e-main-hide-personal-addresses t)
@@ -704,8 +738,14 @@ Otherwise split the current paragraph into one sentence per line."
("/gmail/INBOX" . ?g)
("/queensu/INBOX" . ?q))))
+(use-package mu4e-column-faces
+ :ensure t
+ :after mu4e
+ :config (mu4e-column-faces-mode))
+
;; provided through git/chezmoi
-(use-package mu4e-goodies-tags)
+(use-package mu4e-goodies-tags
+ :after mu4e)
(use-package oauth2
:ensure t)
@@ -716,6 +756,16 @@ Otherwise split the current paragraph into one sentence per line."
(use-package octave
:mode ("\\.m\'" . octave-mode))
+(use-package orderless
+ :ensure t
+ :custom
+ ;; Configure a custom style dispatcher (see the Consult wiki)
+ ;; (orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch))
+ ;; (orderless-component-separator #'orderless-escapable-split-on-space)
+ (completion-styles '(orderless basic))
+ (completion-category-defaults nil)
+ (completion-category-overrides '((file (styles partial-completion)))))
+
(use-package org
:bind (:map org-mode-map
("<tab>" . org-cycle))
@@ -1093,6 +1143,11 @@ If not, issue a warning."
(use-package sass-mode
:ensure t)
+;; Persist history over Emacs restarts. Vertico sorts by history position.
+(use-package savehist
+ :init
+ (savehist-mode))
+
(use-package scroll-bar
:custom
(scroll-bar-mode nil))
@@ -1129,11 +1184,6 @@ If not, issue a warning."
:ensure t
:requires spaceline-config)
-(use-package swiper
- :ensure t
- :bind
- (("C-s" . swiper)))
-
(use-package tex
:ensure auctex
:custom
@@ -1173,18 +1223,24 @@ If not, issue a warning."
:config
(add-hook 'tuareg-mode-hook 'merlin-mode t))
-(use-package twittering-mode
- :ensure t
- :custom
- (twittering-icon-mode t)
- (twittering-icon-storage-file "~/.emacs.d/storage/twittering-mode-icons.gz")
- (twittering-use-icon-storage t))
-
(use-package vc-git
:requires vc
:config
(add-to-list 'vc-handled-backends 'git))
+(use-package vertico
+ :ensure t
+ :custom
+ (vertico-scroll-margin 0) ;; Different scroll margin
+ (vertico-count 20) ;; Show more candidates
+ (vertico-resize t) ;; Grow and shrink the Vertico minibuffer
+ (vertico-cycle t) ;; Enable cycling for `vertico-next/previous'
+ :init
+ (vertico-mode))
+
+(use-package vertico-directory
+ :ensure vertico)
+
(use-package visual-fill-column
:ensure t)