From 29c287a8c31bebe9dd40b499415511c96a1ef6fa Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 30 Mar 2022 18:14:56 -0500 Subject: I waited way too long to make this commit --- init.el | 157 +++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 100 insertions(+), 57 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 5e52215..e032819 100644 --- a/init.el +++ b/init.el @@ -117,12 +117,18 @@ (add-hook 'user-save-hook #'+clean-empty-lines) (user-save-global-mode +1)) +(setup (:require winner) + (winner-mode +1)) + (setup +key (+ensure-after-init #'+key-global-mode)) (setup abbrev (:option abbrev-file-name (sync/ "abbrev.el") save-abbrevs 'silent) +(with-eval-after-load 'user-save + (:with-mode edit-abbrevs-mode + (:hook #'turn-off-user-save-mode))) (:hook-into text-mode circe-chat-mode)) @@ -177,42 +183,41 @@ (add-to-list '+browse-url-secondary-browser-regexps (replace-regexp-in-string "\\." "\\\\." domain))) ;; Set up URL handlers. - (with-eval-after-load 'org-contacts - (require 'chd) - (+browse-url-set-handlers - (list - (cons (rx ; images - "." (or "jpeg" "jpg" "png" "bmp") eos) - (lambda (&rest args) - (apply - (cond ((executable-find "mpv") #'+browse-image-with-mpv) - (t #'eww-browse-url)) - args))) - (cons (rx (or ;; videos - "youtube.com" "youtu.be" "invidious" "yewtu.be" - (seq "." (or "mp4" "gif" "mov" "MOV" "webm") eos) - ;; music - "soundcloud.com" "bandcamp.com" - (seq "." (or "ogg" "mp3" "opus" "m4a") eos))) - (lambda (&rest args) - (apply (if (executable-find "mpv") - #'+browse-url-with-mpv - browse-url-secondary-browser-function) - args))) - (cons chd/url-regexps #'browse-url-chrome) - (cons (+browse-url-secondary-browser-regexps-combine) ; non-text websites - (lambda (&rest args) - (apply browse-url-secondary-browser-function args))) - (cons "xkcd\\.com" - (lambda (&rest args) - (apply (if (fboundp #'xkcd-get) - (progn (require '+xkcd) - #'+xkcd-get-from-url) - +browse-url-browser-function) - args))) - (cons "." ; everything else - (lambda (&rest args) - (apply +browse-url-browser-function args)))))) + (require 'chd) + (+browse-url-set-handlers + (list + (cons (rx ; images + "." (or "jpeg" "jpg" "png" "bmp") eos) + (lambda (&rest args) + (apply + (cond ((executable-find "mpv") #'+browse-image-with-mpv) + (t #'eww-browse-url)) + args))) + (cons (rx (or ;; videos + "youtube.com" "youtu.be" "invidious" "yewtu.be" + (seq "." (or "mp4" "gif" "mov" "MOV" "webm") eos) + ;; music + "soundcloud.com" "bandcamp.com" + (seq "." (or "ogg" "mp3" "opus" "m4a") eos))) + (lambda (&rest args) + (apply (if (executable-find "mpv") + #'+browse-url-with-mpv + browse-url-secondary-browser-function) + args))) + (cons chd/url-regexps #'browse-url-chrome) + (cons (+browse-url-secondary-browser-regexps-combine) ; non-text websites + (lambda (&rest args) + (apply browse-url-secondary-browser-function args))) + (cons "xkcd\\.com" + (lambda (&rest args) + (apply (if (fboundp #'xkcd-get) + (progn (require '+xkcd) + #'+xkcd-get-from-url) + +browse-url-browser-function) + args))) + (cons "." ; everything else + (lambda (&rest args) + (apply +browse-url-browser-function args))))) ;; Transform URLs before passing to `browse-url' (:option +browse-url-transformations `((,(rx (or "youtube.com" "youtu.be")) @@ -472,7 +477,8 @@ (:option notmuch-init-file (notmuch/ "notmuch-init.el" t) notmuch-address-save-filename (notmuch/ "addresses" t) notmuch-address-use-company (featurep 'company) - notmuch-search-oldest-first nil) + notmuch-search-oldest-first nil + notmuch-archive-tags '("-inbox" "-unread")) ;; Composing mail (:option message-kill-buffer-on-exit t message-auto-save-directory "~/var/mail/drafts") @@ -554,6 +560,9 @@ ("+" . "-")) org-log-done 'time org-log-into-drawer t + org-num-skip-commented t + org-num-skip-unnumbered t + org-num-skip-footnotes t org-outline-path-complete-in-steps nil org-pretty-entities t org-pretty-entities-include-sub-superscripts nil @@ -573,6 +582,7 @@ (sequence "|" "CANCELED(k@)") (sequence "MEETING(m)") (sequence "ASSIGNED(a@/!)" "REVIEW(r)" "|" "DONE(d!)")) + org-use-speed-commands t org-emphasis-alist '(("*" org-bold) ("/" org-italic) ("_" org-underline) @@ -612,9 +622,9 @@ ;; complains about "Invalid face reference: t" in org-mode buffers, because ;; `compose-region' returns t. ("^ *\\([-]\\) " - (0 (progn (compose-region (match-beginning 1) (match-end 1) "∙") 'default))) + (0 (progn (compose-region (match-beginning 1) (match-end 1) "›") 'default))) ("^ *\\([+]\\) " - (0 (progn (compose-region (match-beginning 1) (match-end 1) "◦") 'default))))) + (0 (progn (compose-region (match-beginning 1) (match-end 1) "»") 'default))))) (with-eval-after-load 'form-feed ;; Horizontal lines (font-lock-add-keywords @@ -715,6 +725,13 @@ (with-eval-after-load 'user-save (advice-add 'org-export-dispatch :before 'user-save-run-hooks))) +(setup org-id + (:load-after org) + ;; https://helpdeskheadesk.net/2022-03-13/ + (:option org-id-method 'ts + org-attach-id-to-path-function-list '(org-attach-id-ts-folder-format + org-attach-id-uuid-folder-format))) + (setup password-cache (:option password-cache t password-cache-expiry (* 60 60))) @@ -746,8 +763,9 @@ tab-bar-tab-name-ellipsis truncate-string-ellipsis tab-bar-show t tab-bar-close-button-show t - +tab-bar-menu-bar-icon " ☰ " - tab-bar-close-button (propertize " ¬ " + tab-bar-new-button-show nil + +tab-bar-menu-bar-icon " ; " + tab-bar-close-button (propertize "(x)" 'display t 'close-tab t) tab-bar-new-button (propertize "+ " 'display t)) @@ -755,7 +773,7 @@ (:option display-time-format "%H:%M" display-time-mail-file :disable display-time-load-average-threshold 50) - (:option tab-bar-format '(+tab-bar-format-menu-bar + (:option tab-bar-format '(;;+tab-bar-format-menu-bar tab-bar-format-history tab-bar-format-tabs tab-bar-separator @@ -821,7 +839,7 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." (setq affe-regexp-compiler (defun affe-orderless-regexp-compiler (input _type) (setq input (orderless-pattern-compiler input)) (cons input (lambda (str) (orderless--highlight input str))))) - (with-eval-after-load 'affe + (+with-eval-after-loads (affe vertico-multiform) (setf (alist-get 'affe-grep vertico-multiform-commands) '(buffer) (alist-get 'affe-find vertico-multiform-commands) '(buffer)) (:+key "M-s g" #'affe-grep @@ -926,7 +944,7 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." '(cape-file cape-dabbrev cape-keyword - cape-abbrev + ;;cape-abbrev cape-ispell ;;cape-dict )) @@ -1100,6 +1118,11 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." (:with-mode tracking-mode (:option tracking-position 'before-modes) + (:bind "C-c C-SPC" (lambda () (interactive) + (if (and (fboundp 'org-clocking-p) + (org-clocking-p)) + (message "Bro, get back to work!") + (call-interactively #'tracking-next-buffer)))) (add-to-list 'mode-line-misc-info '(tracking-mode tracking-mode-line-buffers))) @@ -1122,7 +1145,7 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." (setup (:straight clhs)) (setup (:straight consult) - (:also-load +consult) + (:require consult +consult) ;; from Consult wiki (:option register-preview-delay 0 register-preview-function #'consult-register-format @@ -1352,7 +1375,8 @@ See also `crux-reopen-as-root-mode'." (:with-mode elfeed-search-mode (:bind "&" #'+elfeed-search-browse-generic "w" #'elfeed-search-yank - "y" nil) + "y" nil + "a" #'+elfeed-show-mark-read-and-advance) (:hook #'hl-line-mode) ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) @@ -1367,7 +1391,8 @@ See also `crux-reopen-as-root-mode'." (:hook #'reading-mode) (:option +elfeed--update-repeat (* 60 30) ; 1/2 hour +elfeed--update-first-time 60)) - (+elfeed-update-async-mode +1)) + (+elfeed-update-async-mode -1) ; It really messes with stuff for work + ) (setup (:straight elfeed-org) (:also-load +org-capture) @@ -1735,9 +1760,9 @@ See also `crux-reopen-as-root-mode'." (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes")) (:also-load dawn) (:option modus-themes-mixed-fonts t - modus-themes-bold-constructs t + modus-themes-bold-constructs nil modus-themes-italic-constructs t - modus-themes-headings '((t . (background)))) + modus-themes-headings '((t . (background regular rainbow)))) (dotimes (facen-1 8) (let ((facen (1+ facen-1))) (custom-set-faces @@ -1746,6 +1771,8 @@ See also `crux-reopen-as-root-mode'." (,(intern (format "modus-themes-heading-%s" facen)) fixed-pitch)) :now))))) + (:face modus-themes-tab-active ((t :bold nil)) + modus-themes-tab-inactive ((t :italic t))) (dawn-schedule #'modus-themes-load-operandi #'modus-themes-load-vivendi)) @@ -1862,6 +1889,9 @@ See also `crux-reopen-as-root-mode'." lisp-interaction-mode scheme-mode)) +(setup (:straight pdf-tools) + (pdf-tools-install)) + ;; (setup (:straight-when pdf-tools ;; ;; Ensure we can build `pdf-tools' ;; (or (executable-find "gcc") @@ -1905,11 +1935,17 @@ See also `crux-reopen-as-root-mode'." :host github :repo "gexplorer/simple-modeline" :fork (:host github :repo "duckwork/simple-modeline"))) (:require +modeline) - (:option +modeline-modified-icon-alist '((ephemeral . "🥞") - (special . "🥐") - (readonly . "🦞") - (modified . "🥪") - (t . "🍞")) + (:option +modeline-modified-icon-alist '((ephemeral . "~") + (special . "*") + (readonly . "=") + (modified . "+") + (t . "-")) + ;; '((ephemeral . "🥞") + ;; (special . "🥐") + ;; (readonly . "🦞") + ;; (modified . "🥪") + ;; (t . "🍞")) + +modeline-minions-icon ";" simple-modeline-segments `(( ; left @@ -1950,10 +1986,14 @@ See also `crux-reopen-as-root-mode'." slack-buffer-emojify t slack-buffer-create-on-notify t slack-enable-wysiwyg t - slack-file-dir "~/var/download/" + slack-file-dir (xdg-user-dir "DOWNLOAD") slack-display-team-name nil) (with-eval-after-load '+slack - (+slack-register-teams))) + (+slack-register-teams)) + (with-eval-after-load 'alert + ;; Don't notify for Slack messages + (alert-add-rule :category "slack" + :style 'ignore))) (setup (:straight-when sly (defvar +lisp-bin (executable-find "sbcl"))) @@ -2055,6 +2095,9 @@ See also `crux-reopen-as-root-mode'." (setup (:straight unfill)) +(setup (:straight valign) + (:hook-into org-mode)) + (setup (:straight valign) (:quit "Doesn't work with narrowed tables.") (:option valign-fancy-bar t) (:hook-into org-mode @@ -2065,7 +2108,7 @@ See also `crux-reopen-as-root-mode'." :repo "minad/vertico" :files ("*" "extensions/*" (:exclude ".git")))) - (:also-load +vertico) + (:require vertico +vertico) (:option resize-mini-windows 'grow-only vertico-count-format nil vertico-cycle t) -- cgit 1.4.1-21-gabe81