From ccff884113100bf42cb330d8feccbbd4a82d45e6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 17 Dec 2021 18:31:24 -0600 Subject: Bunches o changes I was gonna try to like, make these atomic, but oops --- init.el | 250 ++++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 142 insertions(+), 108 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 3f85381..bda1fd8 100644 --- a/init.el +++ b/init.el @@ -26,7 +26,8 @@ ;; necessary for good functioning. In this block, I add extra ;; things or more "experimental" ones that might not belong in a ;; separate file. - (:global "C-x C-k" 'kill-this-buffer) + (:global "C-x C-k" 'kill-this-buffer + "C-x 4 n" 'clone-buffer) ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults (global-set-key (kbd "C-h") 'delete-backward-char) (keyboard-translate ?\C-h ?\C-?)) @@ -47,6 +48,11 @@ "~/.authinfo" "~/.authinfo.gpg"))) +(setup (:require goto-addr) + (if (fboundp #'global-goto-address-mode) + (global-goto-address-mode) + (add-hook 'after-change-major-mode-hook #'goto-address-mode))) + (setup (:require pulse) (:also-load +pulse) (:option pulse-flag nil @@ -55,6 +61,63 @@ (append +pulse-location-commands) 'lui-track-jump-to-indicator) (+pulse-location-mode +1)) +(setup abbrev + (:option abbrev-file-name (sync/ "abbrev.el") + save-abbrevs 'silent) + (:hook-into text-mode + circe-chat-mode)) + +(setup autorevert + (:option global-auto-revert-non-file-buffers t + auto-revert-verbose nil) + (global-auto-revert-mode +1)) + +(setup browse-url + (:require +browse-url) + (:option browse-url-secondary-browser-function (if (executable-find "firefox") + 'browse-url-firefox + 'browse-url-default-browser) + browse-url-new-window-flag nil + browse-url-firefox-arguments '("--new-tab") + browse-url-firefox-new-window-is-tab t) + ;; Set up URL handlers. + (+browse-url-set-handlers + (list + (cons (rx ; images + "." (or "jpeg" "jpg" "png") eos) + (lambda (&rest args) + (apply + (cond ((executable-find "mpv") '+browse-image-with-mpv) + (t 'eww-browse-url)) + args))) + (cons (rx ; videos + (or "youtube.com" "youtu.be" "yewtu.be" + (seq "." (or "mp4" "gif" "mov" "MOV") eos))) + (lambda (&rest args) + (apply (if (executable-find "mpv") + '+browse-url-with-mpv + browse-url-secondary-browser-function) + args))) + (cons (rx ; non-eww-friendly websites + (or + "github.com" + "gitlab.com" + "google.com" + "imgur.com" + "pixelfed" + "reddit.com" + "taskiq" + "twitter.com" "nitter.com" + )) + browse-url-secondary-browser-function) + (cons "." ; everything else + 'eww-browse-url))) + ;; Transform URLs before passing to `browse-url' + (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" + "youtu.be")) + . "//yewtu.be"))) + (+browse-url-transform-url-global-mode +1)) + (setup calendar (require '_location) (:option calendar-location-name _location-name @@ -159,6 +222,13 @@ 'display-fill-column-indicator-mode 'turn-on-auto-fill)) +(setup scratch + (:require +scratch) + (:option initial-major-mode 'lisp-interaction-mode + initial-scratch-message + ";; ABANDON ALL HOPE YE WHO ENTER HERE\n\n") + (add-hook 'kill-buffer-query-functions '+scratch-immortal)) + (setup text (:hook 'turn-on-auto-fill)) @@ -200,16 +270,17 @@ (setup (:straight (cape :host github :repo "minad/cape")) (dolist (fn '(;; All available cape capfs listed here. - cape-file-capf - cape-dabbrev-capf - cape-keyword-capf - ;;cape-abbrev-capf - ;;cape-ispell-capf - ;;cape-dict-capf + cape-file + cape-dabbrev + cape-keyword + ;;cape-abbrev + ;;cape-ispell + ;;cape-dict )) (add-to-list 'completion-at-point-functions fn))) (setup (:straight (capf-autosuggest + :host nil :repo "https://repo.or.cz/emacs-capf-autosuggest.git")) (:hook-into eshell-mode comint-mode)) @@ -217,12 +288,13 @@ (setup (:straight circadian) (:option circadian-themes '((:sunrise . modus-operandi) (:sunset . modus-vivendi))) - (circadian-setup)) + (add-hook 'after-init-hook 'circadian-setup)) (setup (:straight circe) (:require _circe +circe) - (autoload '+irc "+circe" "Connect to IRC." t) + (:also-load circe-chanop) + ;;(autoload '+irc "+circe" "Connect to IRC." t) ;; Formatting options (:option circe-format-action (format (format "%%%ds* {nick} {body}" @@ -294,12 +366,8 @@ visual-fill-column-extra-text-width (cons +circe-left-margin 0))) - (add-hook 'kill-emacs-hook - (defun circe-quit-all () - (ignore-errors - (advice-remove 'circe-command-GQUIT - 'circe-gquit@kill-buffer) - (circe-command-GQUIT "Quitting Emacs, bye!"))))) + (add-hook 'modus-themes-after-load-theme-hook 'circe-nick-color-reset) + (add-hook 'kill-emacs-hook '+circe-quit-all@kill-emacs)) (setup (:straight consult) (:also-load +consult) @@ -424,12 +492,31 @@ See also `crux-reopen-as-root-mode'." (autoload 'global-dictionary-tooltip-mode "dictionary" "Enable/disable dictionary-tooltip-mode for all buffers" t)) +(setup (:straight (discord + :host github + :repo "davep/discord.el" + :fork (:repo "duckwork/discord.el")))) + (setup (:straight electric-cursor) (electric-cursor-mode +1)) (setup (:straight electric-cursor) (electric-cursor-mode +1)) +(setup (:straight elfeed) + (:also-load +elfeed) + (:option elfeed-use-curl t + elfeed-curl-extra-arguments '("--insecure") + elfeed-show-unique-buffers t + elfeed-db-directory (sync/ "elfeed/db/" t)) + (:with-mode elfeed-show-mode + (:bind "SPC" '+elfeed-scroll-up-command + "S-SPC" '+elfeed-scroll-down-command))) + +(setup (:straight elfeed-org) + (:option rmh-elfeed-org-files (list (sync/ "elfeed/elfeed.org" t))) + (elfeed-org)) + (setup (:straight embark) (:option prefix-help-command 'embark-prefix-help-command) (:+key "C-." 'embark-act @@ -529,6 +616,20 @@ See also `crux-reopen-as-root-mode'." (setup (:straight lacarte) (:+key "" 'lacarte-execute-menu-command)) +(setup (:straight (lin :host gitlab :repo "protesilaos/lin")) + (require 'lin) + (:hook-into dired-mode + elfeed-search-mode + git-rebase-mode + ibuffer-mode + ledger-report-mode + log-view-mode + magit-log-mode + notmuch-search-mode + notmuch-tree-mode + org-agenda-mode + tabulated-list-mode)) + (setup (:straight marginalia) (marginalia-mode +1)) @@ -543,7 +644,11 @@ See also `crux-reopen-as-root-mode'." (setup (:straight (modus-themes :host gitlab - :repo "protesilaos/modus-themes"))) + :repo "protesilaos/modus-themes")) + (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes")) + (:option modus-themes-bold-constructs t + modus-themes-italic-constructs t + modus-themes-headings '((t . (background))))) (setup (:straight mwim) (:+key "C-a" #'mwim-beginning @@ -553,7 +658,7 @@ See also `crux-reopen-as-root-mode'." (:option completion-styles '(orderless))) (setup (:straight (org - :type git + :type git :host nil :repo "https://git.savannah.gnu.org/git/emacs/org-mode.git" :local-repo "org" :depth full @@ -563,7 +668,7 @@ See also `crux-reopen-as-root-mode'." "lisp/*.el" ("etc/styles/" "etc/styles/*"))) (org-contrib - :type git + :type git :host nil :repo "https://git.sr.ht/~bzg/org-contrib")) ;; DO NOT load system-installed org !!! (setq load-path (cl-remove-if (lambda (path) @@ -572,6 +677,8 @@ See also `crux-reopen-as-root-mode'." (:also-load +org ox-md) (:option org-adapt-indentation nil + org-agenda-skip-deadline-if-done t + org-archive-mark-done t org-catch-invisible-edits 'show-and-error org-clock-clocked-in-display 'mode-line org-clock-frame-title-format (cons @@ -594,7 +701,7 @@ See also `crux-reopen-as-root-mode'." org-fontify-quote-and-verse-blocks t org-fontify-whole-heading-line t org-hide-emphasis-markers t - org-html-coding-system 'utf-8-unix + org-html-coding-system 'utf-8-unix org-image-actual-width (list (* (window-font-width) (- fill-column 8))) org-imenu-depth 3 @@ -620,11 +727,14 @@ See also `crux-reopen-as-root-mode'." "C-c C-l" '+org-insert-link-dwim "C-c C-n" '+org-next-heading-widen "C-c C-p" '+org-previous-heading-widen) + (:+leader "c" 'org-capture "C-c" 'org-capture + "a" 'org-agenda "C-a" 'org-agenda) (:local-set unfill-fill-function 'org-fill-paragraph) (:local-hook before-save-hook '+org-before-save@prettify-buffer) (advice-add 'org-delete-backward-char :override '+org-delete-backward-char) (with-eval-after-load 'org - (org-clock-persistence-insinuate))) + (org-clock-persistence-insinuate) + (org-link-set-parameters "tel" :follow '+org-tel-open))) (setup (:straight org-appear) (:option org-appear-autoemphasis t @@ -653,13 +763,9 @@ See also `crux-reopen-as-root-mode'." lisp-interaction-mode scheme-mode)) -(setup (:straight scratch) - (:require +scratch) - (:option initial-major-mode 'emacs-lisp-mode - initial-scratch-message - ";; ABANDON ALL HOPE YE WHO ENTER HERE\n") - (add-hook 'kill-buffer-query-functions '+scratch-immortal) - (add-hook 'scratch-create-buffer-hook '+scratch-buffer-setup)) +(setup (:straight-when pdf-tools + (eq system-type 'gnu/linux)) + (pdf-tools-install)) (setup (:straight (shell-command+ :host nil @@ -673,7 +779,9 @@ See also `crux-reopen-as-root-mode'." :fork (:repo "duckwork/simple-modeline"))) (:also-load +modeline) (:option simple-modeline-segments '((;; left + +modeline-ace-window-display +modeline-modified + +modeline-narrowed +modeline-buffer-name +modeline-position +modeline-anzu @@ -684,7 +792,6 @@ See also `crux-reopen-as-root-mode'." simple-modeline-segment-misc-info simple-modeline-segment-process +modeline-text-scale - +modeline-narrowed +modeline-minions +modeline-major-mode))) (simple-modeline-mode +1)) @@ -692,6 +799,9 @@ See also `crux-reopen-as-root-mode'." (setup (:straight smartscan) (smartscan-mode +1)) +(setup (:straight smartscan) + (smartscan-mode +1)) + (setup (:straight (sophomore :host github :repo "duckwork/sophomore.el")) @@ -732,6 +842,7 @@ See also `crux-reopen-as-root-mode'." 0)))) (funcall topsy-fn)))))) + (setup (:straight trashed) (:option trashed-action-confirmer #'y-or-n-p)) @@ -779,6 +890,9 @@ See also `crux-reopen-as-root-mode'." (with-eval-after-load 'visual-fill-column (advice-add 'text-scale-adjust :after 'visual-fill-column-adjust))) +(setup (:straight vlf) + (:require vlf-setup)) + (setup (:straight whitespace-cleanup-mode) (:option whitespace-cleanup-mode-preserve-point t) ;;(remove-hook 'before-save-hook 'whitespace-cleanup) @@ -790,83 +904,3 @@ See also `crux-reopen-as-root-mode'." (interactive "P") (call-interactively (if prefix #'zzz-up-to-char #'zzz-to-char))))) - -(setup (:straight elfeed) - (:also-load +elfeed) - (:option elfeed-use-curl t - elfeed-curl-extra-arguments '("--insecure") - elfeed-show-unique-buffers t - elfeed-db-directory (sync/ "elfeed/db/" t)) - (:with-mode elfeed-show-mode - (:bind "SPC" '+elfeed-scroll-up-command - "S-SPC" '+elfeed-scroll-down-command))) - -(setup (:straight elfeed-org) - (:option rmh-elfeed-org-files (list (sync/ "elfeed/elfeed.org" t))) - (elfeed-org)) - -(setup (:straight (lin :host gitlab :repo "protesilaos/lin")) - (require 'lin) - (:hook-into dired-mode - elfeed-search-mode - git-rebase-mode - ibuffer-mode - ledger-report-mode - log-view-mode - magit-log-mode - notmuch-search-mode - notmuch-tree-mode - org-agenda-mode - tabulated-list-mode)) - - -(setup browse-url - (:also-load +browse-url) - (:option browse-url-secondary-browser-function (if (executable-find "firefox") - 'browse-url-firefox - 'browse-url-default-browser) - browse-url-new-window-flag nil - browse-url-firefox-arguments '("--new-tab") - browse-url-firefox-new-window-is-tab t) - ;; Set up URL handlers. - (+browse-url-set-handlers - (list - (cons (rx ; images - "." (or "jpeg" "jpg" "png") eos) - (lambda (&rest args) - (apply - (cond ((executable-find "feh") '+browse-url-with-feh) - ((executable-find "mpv") '+browse-image-with-mpv) - (t 'eww-browse-url)) - args))) - (cons (rx ; videos - (or "youtube.com" "youtu.be" "yewtu.be" - (seq "." (or "mp4" "gif" "mov" "MOV") eos))) - (lambda (&rest args) - (apply (if (executable-find "mpv") - 'browse-url-mpv - browse-url-secondary-browser-function) - args))) - (cons (rx ; non-eww-friendly websites - (or - "github.com" - "gitlab.com" - "google.com" - "imgur.com" - "pixelfed" - "reddit.com" - "taskiq" - "twitter.com" - )) - browse-url-secondary-browser-function) - (cons "." ; everything else - 'eww-browse-url))) - ;; Transform URLs before passing to `browse-url' - (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" - "youtu.be")) - . "//yewtu.be"))) - (+browse-url-transform-url-global-mode +1)) - -(setup (:straight-when pdf-tools - (eq system-type 'gnu/linux)) - (pdf-tools-install)) -- cgit 1.4.1-21-gabe81