summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2022-01-10 08:33:43 -0600
committerCase Duckworth2022-01-10 08:33:43 -0600
commit2918cb39a25558b8896bf212b68e22d1fde02032 (patch)
treee6eef338bddf327236d305ef0310fd793e9f8062 /init.el
parentAdd markdown (diff)
parentAdd a few packages and .. stuff (diff)
downloademacs-2918cb39a25558b8896bf212b68e22d1fde02032.tar.gz
emacs-2918cb39a25558b8896bf212b68e22d1fde02032.zip
Merge branch 'main' of https://tildegit.org/acdw/emacs
Diffstat (limited to 'init.el')
-rw-r--r--init.el156
1 files changed, 109 insertions, 47 deletions
diff --git a/init.el b/init.el index 46cd281..ae61b87 100644 --- a/init.el +++ b/init.el
@@ -38,11 +38,12 @@
38 "C-x o" (lambda () (interactive) (switch-to-buffer nil)) 38 "C-x o" (lambda () (interactive) (switch-to-buffer nil))
39 "C-x C-o" #'+open-paragraph 39 "C-x C-o" #'+open-paragraph
40 "C-w" #'+kill-word-backward-or-region 40 "C-w" #'+kill-word-backward-or-region
41 "C-x C-1" #'delete-other-windows 41 ;; "C-x C-1" #'delete-other-windows
42 "C-x 2" #'+split-window-below-then 42 ;; "C-x 2" #'+split-window-below-then
43 "C-x C-2" #'+split-window-below-then 43 ;; "C-x C-2" #'+split-window-below-then
44 "C-x 3" #'+split-window-right-then 44 ;; "C-x 3" #'+split-window-right-then
45 "C-x C-3" #'+split-window-right-then) 45 ;; "C-x C-3" #'+split-window-right-then
46 )
46 ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults 47 ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults
47 (global-set-key (kbd "C-h") 'delete-backward-char) 48 (global-set-key (kbd "C-h") 'delete-backward-char)
48 (keyboard-translate ?\C-h ?\C-?) 49 (keyboard-translate ?\C-h ?\C-?)
@@ -58,9 +59,6 @@
58 (:bind "C-c s" #'+init-sort-then-save) 59 (:bind "C-c s" #'+init-sort-then-save)
59 (:hook #'+init-add-setup-to-imenu)) 60 (:hook #'+init-add-setup-to-imenu))
60 61
61(setup (:require +lookup)
62 (+lookup-mode +1))
63
64(setup (:require auth-source) 62(setup (:require auth-source)
65 (:option auth-sources (list (private/ "authinfo")))) 63 (:option auth-sources (list (private/ "authinfo"))))
66 64
@@ -109,6 +107,9 @@
109 (:option pulse-flag nil 107 (:option pulse-flag nil
110 pulse-delay 0.5 108 pulse-delay 0.5
111 pulse-iterations 1) 109 pulse-iterations 1)
110 (dolist (command '(+ace-window-or-switch-buffer
111 pop-mark pop-globl-mark))
112 (add-to-list '+pulse-location-commands command))
112 (+ensure-after-init #'+pulse-location-mode)) 113 (+ensure-after-init #'+pulse-location-mode))
113 114
114(setup (:require reading) 115(setup (:require reading)
@@ -137,6 +138,15 @@
137 (:option 138 (:option
138 browse-url-browser-function #'eww-browse-url 139 browse-url-browser-function #'eww-browse-url
139 +browse-url-browser-function browse-url-browser-function 140 +browse-url-browser-function browse-url-browser-function
141 browse-url-generic-program (seq-some #'executable-find
142 '("firefox"
143 "chromium"
144 "chrome"))
145 browse-url-generic-args (seq-some (lambda (e)
146 (when (equal (executable-find (car e))
147 browse-url-generic-program)
148 (cdr e)))
149 '(("firefox" "--new-tab")))
140 browse-url-secondary-browser-function (if (executable-find "firefox") 150 browse-url-secondary-browser-function (if (executable-find "firefox")
141 #'browse-url-firefox 151 #'browse-url-firefox
142 #'browse-url-default-browser) 152 #'browse-url-default-browser)
@@ -230,7 +240,7 @@
230 copy move hardlink symlink 240 copy move hardlink symlink
231 shell touch) 241 shell touch)
232 dired-dwim-target t) 242 dired-dwim-target t)
233 (:local-set truncate-lines nil) 243 (:local-set truncate-lines t)
234 (:bind "<backspace>" #'dired-up-directory 244 (:bind "<backspace>" #'dired-up-directory
235 "TAB" #'dired-subtree-cycle 245 "TAB" #'dired-subtree-cycle
236 "i" #'dired-subtree-toggle 246 "i" #'dired-subtree-toggle
@@ -475,13 +485,19 @@
475 (with-eval-after-load 'org 485 (with-eval-after-load 'org
476 (org-clock-persistence-insinuate) 486 (org-clock-persistence-insinuate)
477 (org-link-set-parameters "tel" :follow #'+org-tel-open)) 487 (org-link-set-parameters "tel" :follow #'+org-tel-open))
478 ;; Fancy list bullets 488 ;; Extra keywords
479 (font-lock-add-keywords 489 (font-lock-add-keywords
480 'org-mode 490 'org-mode
481 '(("^ *\\([-]\\) " 491 '(;; Fancy list bullets
492 ("^ *\\([-]\\) "
482 (0 (compose-region (match-beginning 1) (match-end 1) "•"))) 493 (0 (compose-region (match-beginning 1) (match-end 1) "•")))
483 ("^ *\\([+]\\) " 494 ("^ *\\([+]\\) "
484 (0 (compose-region (match-beginning 1) (match-end 1) "◦")))))) 495 (0 (compose-region (match-beginning 1) (match-end 1) "◦"))))
496 (with-eval-after-load 'form-feed
497 ;; Horizontal lines
498 (font-lock-add-keywords
499 'org-mode
500 '(("^-----+" 0 'form-feed--font-lock-face t))))))
485 501
486(setup org-agenda 502(setup org-agenda
487 (:option org-agenda-skip-deadline-if-done t 503 (:option org-agenda-skip-deadline-if-done t
@@ -586,9 +602,6 @@
586 (executable-find "diff")) 602 (executable-find "diff"))
587 (:require apheleia 603 (:require apheleia
588 +apheleia) 604 +apheleia)
589 (setf (alist-get 'indent-region apheleia-formatters) #'+apheleia-indent-region
590 (alist-get 'emacs-lisp-mode apheleia-mode-alist) 'indent-region
591 (alist-get 'lisp-interaction-mode apheleia-mode-alist) 'indent-region)
592 (apheleia-global-mode +1)) 605 (apheleia-global-mode +1))
593 606
594(setup (:straight avy) 607(setup (:straight avy)
@@ -721,9 +734,15 @@
721 (advice-add #'circe-command-GQUIT :after #'+circe-gquit@kill-buffer) 734 (advice-add #'circe-command-GQUIT :after #'+circe-gquit@kill-buffer)
722 735
723 (:with-mode circe-chat-mode 736 (:with-mode circe-chat-mode
737 (:local-set lui-input-function #'+lui-filter)
724 (:hook #'enable-circe-color-nicks 738 (:hook #'enable-circe-color-nicks
725 #'enable-circe-new-day-notifier 739 #'enable-circe-new-day-notifier
726 #'+circe-chat@set-prompt) 740 #'+circe-chat@set-prompt
741 ;; Filters
742 #'+circe-F/C-mode
743 ;; For some reason `+circe-shorten-url-mode' won't work right out of
744 ;; the gate.
745 (lambda () (run-with-idle-timer 0.25 nil #'+circe-shorten-url-mode)))
727 (:bind "C-c C-s" #'circe-command-SLAP)) 746 (:bind "C-c C-s" #'circe-command-SLAP))
728 747
729 (:with-mode lui-mode 748 (:with-mode lui-mode
@@ -889,14 +908,16 @@ See also `crux-reopen-as-root-mode'."
889 (:option dictionary-use-single-buffer t) 908 (:option dictionary-use-single-buffer t)
890 (autoload 'dictionary-search "dictionary" 909 (autoload 'dictionary-search "dictionary"
891 "Ask for a word and search it in all dictionaries" t) 910 "Ask for a word and search it in all dictionaries" t)
892 (:hook #'reading-mode) 911 (:hook #'reading-mode))
893 (define-key +lookup-mode-map "d" #'dictionary-search))
894 912
895(setup (:straight (discord 913(setup (:straight (discord
896 :host github 914 :host github
897 :repo "davep/discord.el" 915 :repo "davep/discord.el"
898 :fork (:repo "duckwork/discord.el")))) 916 :fork (:repo "duckwork/discord.el"))))
899 917
918(setup (:straight dumb-jump)
919 (add-hook 'xref-backend-functions #'dumb-jump-xref-activate))
920
900(setup (:straight electric-cursor) 921(setup (:straight electric-cursor)
901 (:option electric-cursor-alist '((overwrite-mode . hbar) 922 (:option electric-cursor-alist '((overwrite-mode . hbar)
902 (god-local-mode . box))) 923 (god-local-mode . box)))
@@ -918,15 +939,20 @@ See also `crux-reopen-as-root-mode'."
918 elfeed-search-title-min-width 24 939 elfeed-search-title-min-width 24
919 elfeed-search-title-max-width 78 940 elfeed-search-title-max-width 78
920 elfeed-show-unique-buffers t 941 elfeed-show-unique-buffers t
921 elfeed-db-directory (elfeed/ "db/" t)) 942 elfeed-db-directory (elfeed/ "db/" t)
922 (:+key "C-x w" #'+elfeed) 943 elfeed-log 'debug ; until I can figure out syncing...
944 )
945 (:+key "C-x w" #'elfeed)
923 (:with-mode elfeed-search-mode 946 (:with-mode elfeed-search-mode
947 (:bind "&" #'+elfeed-search-browse-generic)
924 (:hook #'hl-line-mode) 948 (:hook #'hl-line-mode)
925 ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ 949 ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/
926 (advice-add #'elfeed-search-update--force :after #'elfeed-db-save)) 950 (advice-add #'elfeed-search-update--force :after #'elfeed-db-save)
951 (advice-add #'elfeed :before #'elfeed-db-load))
927 (:with-mode elfeed-show-mode 952 (:with-mode elfeed-show-mode
928 (:bind "SPC" #'+elfeed-scroll-up-command 953 (:bind "SPC" #'+elfeed-scroll-up-command
929 "S-SPC" #'+elfeed-scroll-down-command) 954 "S-SPC" #'+elfeed-scroll-down-command
955 "&" #'+elfeed-show-browse-generic)
930 (:hook #'reading-mode) 956 (:hook #'reading-mode)
931 ;; (define-advice elfeed-show-entry (:after (&rest _)) 957 ;; (define-advice elfeed-show-entry (:after (&rest _))
932 ;; "Re-flow the entry a short time after showing it." 958 ;; "Re-flow the entry a short time after showing it."
@@ -945,14 +971,16 @@ See also `crux-reopen-as-root-mode'."
945(setup (:straight elpher)) 971(setup (:straight elpher))
946 972
947(setup (:straight embark) 973(setup (:straight embark)
948 (:also-load +embark) 974 (:require embark
975 +embark)
949 (:option prefix-help-command 'embark-prefix-help-command 976 (:option prefix-help-command 'embark-prefix-help-command
950 embark-keymap-prompter-key ";") 977 embark-keymap-prompter-key ";")
951 (:+key "C-." #'embark-act 978 (:+key "C-." #'embark-act
952 "M-." #'embark-dwim 979 "M-." #'embark-dwim
953 "<f1> B" #'embark-bindings) 980 "<f1> B" #'embark-bindings)
954 (:with-map minibuffer-local-map 981 (:with-map minibuffer-local-map
955 (:bind "C-." #'embark-act)) 982 (:bind "C-." #'embark-act
983 "M-." #'embark-dwim))
956 (:with-map embark-file-map 984 (:with-map embark-file-map
957 (:bind "l" #'vlf))) 985 (:bind "l" #'vlf)))
958 986
@@ -1059,14 +1087,14 @@ See also `crux-reopen-as-root-mode'."
1059 (:file-match (rx ".rkt" eos) 1087 (:file-match (rx ".rkt" eos)
1060 (rx ".scm" eos))) 1088 (rx ".scm" eos)))
1061 1089
1062(setup (:straight god-mode) 1090;; (setup (:straight god-mode)
1063 (setq god-mode-enable-function-key-translation nil) 1091;; (setq god-mode-enable-function-key-translation nil)
1064 (:require god-mode 1092;; (:require god-mode
1065 +god-mode) 1093;; +god-mode)
1066 (:+key "C-M-g" #'god-mode-all) 1094;; (:+key "C-M-g" #'god-mode-all)
1067 (:with-mode god-local-mode 1095;; (:with-mode god-local-mode
1068 (:bind "i" #'+god-mode-insert 1096;; (:bind "i" #'+god-mode-insert
1069 "a" nil))) 1097;; "a" nil)))
1070 1098
1071(setup (:straight helpful) 1099(setup (:straight helpful)
1072 (run-with-idle-timer 0.5 nil 1100 (run-with-idle-timer 0.5 nil
@@ -1132,17 +1160,9 @@ See also `crux-reopen-as-root-mode'."
1132 1160
1133(setup (:straight (lin :host gitlab :repo "protesilaos/lin")) 1161(setup (:straight (lin :host gitlab :repo "protesilaos/lin"))
1134 (require 'lin) 1162 (require 'lin)
1135 (:hook-into dired-mode 1163 (dolist (hook lin-foreign-hooks)
1136 elfeed-search-mode 1164 (add-hook hook #'hl-line-mode)
1137 git-rebase-mode 1165 (add-hook hook #'lin-mode)))
1138 ibuffer-mode
1139 ledger-report-mode
1140 log-view-mode
1141 magit-log-mode
1142 notmuch-search-mode
1143 notmuch-tree-mode
1144 org-agenda-mode
1145 tabulated-list-mode))
1146 1166
1147(setup (:straight link-hint) 1167(setup (:straight link-hint)
1148 (:require +link-hint) 1168 (:require +link-hint)
@@ -1155,6 +1175,11 @@ See also `crux-reopen-as-root-mode'."
1155 "m" #'link-hint-open-multiple-links 1175 "m" #'link-hint-open-multiple-links
1156 "M-c" #'link-hint-copy-link "c" #'link-hint-copy-link))) 1176 "M-c" #'link-hint-copy-link "c" #'link-hint-copy-link)))
1157 1177
1178(setup (:straight macrostep)
1179 (:require macrostep)
1180 (:with-mode emacs-lisp-mode
1181 (:bind "C-c e" #'macrostep-expand)))
1182
1158(setup (:straight marginalia) 1183(setup (:straight marginalia)
1159 (marginalia-mode +1)) 1184 (marginalia-mode +1))
1160 1185
@@ -1212,6 +1237,9 @@ See also `crux-reopen-as-root-mode'."
1212 org-visibility-include-regexps '("\\.org\\'")) 1237 org-visibility-include-regexps '("\\.org\\'"))
1213 (org-visibility-enable-hooks)) 1238 (org-visibility-enable-hooks))
1214 1239
1240(setup (:straight orglink)
1241 (global-orglink-mode +1))
1242
1215(setup (:straight package-lint 1243(setup (:straight package-lint
1216 package-lint-flymake) 1244 package-lint-flymake)
1217 (add-hook 'emacs-mode-hook #'package-lint-flymake-setup) 1245 (add-hook 'emacs-mode-hook #'package-lint-flymake-setup)
@@ -1317,8 +1345,10 @@ See also `crux-reopen-as-root-mode'."
1317 :host github 1345 :host github
1318 :repo "duckwork/titlecase.el" 1346 :repo "duckwork/titlecase.el"
1319 :files ("*"))) 1347 :files ("*")))
1320 (:with-map +casing-mode-map 1348 (:require titlecase)
1321 (:bind "t" #'titlecase-dwim))) 1349 (:with-map +casing-map
1350 (:bind "t" #'titlecase-dwim
1351 "M-t" #'titlecase-dwim)))
1322 1352
1323(setup (:straight topsy) 1353(setup (:straight topsy)
1324 (:hook-into ;;prog-mode 1354 (:hook-into ;;prog-mode
@@ -1377,11 +1407,37 @@ See also `crux-reopen-as-root-mode'."
1377 (add-to-list 'native-comp-deferred-compilation-deny-list "vertico")) 1407 (add-to-list 'native-comp-deferred-compilation-deny-list "vertico"))
1378 (vertico-mode +1) 1408 (vertico-mode +1)
1379 ;; Extensions 1409 ;; Extensions
1380 (:also-load vertico-directory) 1410 (:also-load vertico-directory
1411 vertico-mouse
1412 vertico-unobtrusive
1413 vertico-multiform)
1414 (vertico-mouse-mode +1)
1415 (vertico-multiform-mode +1)
1416 (:option vertico-multiform-commands '((execute-extended-command flat)
1417 (helpful-function)
1418 (helpful-macro)
1419 (helpful-callable)
1420 (helpful-variable))
1421 ;; This is applied /after/ the above, so default is at the end of
1422 ;; this alist.
1423 vertico-multiform-categories '((file buffer grid)
1424 (t unobtrusive)))
1425 (dolist (buf-cmd '(consult-find
1426 consult-locate
1427 consult-grep
1428 consult-git-grep
1429 consult-ripgrep
1430 consult-line
1431 consult-line-multi
1432 consult-multi-occur
1433 consult-keep-lines
1434 consult-focus-lines))
1435 (setf (alist-get buf-cmd vertico-multiform-commands) '(buffer)))
1381 (:with-map vertico-map 1436 (:with-map vertico-map
1382 (:bind "RET" #'vertico-directory-enter 1437 (:bind "RET" #'vertico-directory-enter
1383 "DEL" #'vertico-directory-delete-char 1438 "DEL" #'vertico-directory-delete-char
1384 "M-DEL" #'vertico-directory-delete-word)) 1439 "M-DEL" #'vertico-directory-delete-word
1440 "TAB" #'+vertico-widen-or-complete))
1385 (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)) 1441 (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy))
1386 1442
1387(setup (:straight visual-fill-column) 1443(setup (:straight visual-fill-column)
@@ -1412,6 +1468,12 @@ See also `crux-reopen-as-root-mode'."
1412 (:hook-into org-mode 1468 (:hook-into org-mode
1413 latex-mode)) 1469 latex-mode))
1414 1470
1471(setup (:straight yasnippet)
1472 (:option yas-snippet-dirs (list
1473 (expand-file-name "snippets" user-emacs-directory)
1474 (sync/ "emacs/snippets" t)))
1475 (yas-global-mode +1))
1476
1415(setup (:straight zoom-frm)) 1477(setup (:straight zoom-frm))
1416 1478
1417(setup (:straight zzz-to-char) 1479(setup (:straight zzz-to-char)