summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el157
1 files changed, 82 insertions, 75 deletions
diff --git a/init.el b/init.el index 208cfe8..cbdec9a 100644 --- a/init.el +++ b/init.el
@@ -19,7 +19,7 @@
19;;; Setup 19;;; Setup
20 20
21;;;; `setup' 21;;;; `setup'
22(straight-use-package '(setup :host nil :repo "https://git.sr.ht/~zge/setup")) 22(straight-use-package '(setup :host nil :repo "https://git.sr.ht/~pkal/setup"))
23(require 'setup) 23(require 'setup)
24 24
25(setup setup 25(setup setup
@@ -174,25 +174,31 @@
174 custom-unlispify-tag-names nil 174 custom-unlispify-tag-names nil
175 custom-variable-default-form 'lisp) 175 custom-variable-default-form 'lisp)
176 176
177 (defun unpackaged/custom-toggle-all-more-hide (&rest _) 177 ;; `Custom-mode-hook' fires /before/ the widgets are built, so I have to
178 "Toggle all \"More/Hide\" widgets in current buffer." 178 ;; install advice after the widgets are made.
179 (interactive) 179 (advice-add
180 (widget-map-buttons (lambda (widget _) 180 'custom-buffer-create :after
181 (pcase (widget-get widget :off) 181 (defun custom-buffer@expand-widgets (&rest _)
182 ("More" (widget-apply-action widget))) 182 "Expand descriptions and values of variables in `Custom-mode' buffers."
183 nil))) 183 (interactive)
184 (advice-add 'custom-buffer-create 184 ;; "More/Hide" widgets (thanks alphapapa!)
185 :after #'unpackaged/custom-toggle-all-more-hide) 185 (widget-map-buttons (lambda (widget _)
186 186 (pcase (widget-get widget :off)
187 (defun acdw/custom-toggle-showing-all-values (&rest _) 187 ("More" (widget-apply-action widget)))
188 "Toggle all \"Show Value\" widgets in current buffer." 188 nil))
189 (interactive) 189 ;; "Show Value" widgets (the little triangles)
190 (widget-map-buttons (lambda (widget _) 190 (widget-map-buttons (lambda (widget _)
191 (pcase (widget-get widget :off) 191 (pcase (widget-get widget :off)
192 ("Show Value" (widget-apply-action widget))) 192 ("Show Value" (widget-apply-action widget)))
193 nil))) 193 nil))))
194 (advice-add 'custom-buffer-create 194
195 :after #'acdw/custom-toggle-showing-all-values)) 195 (add-hook ; thanks u/oantolin!
196 'Custom-mode-hook
197 (defun custom-mode@imenu ()
198 "Build `imenu' for `Custom-mode'."
199 (setq imenu-generic-expression
200 '(("Faces" "^\\(?:Show\\|Hide\\) \\(.*\\) face: \\[sample\\]" 1)
201 ("Variables" "^\\(?:Show Value\\|Hide\\) \\([^:\n]*\\)" 1))))))
196 202
197(setup debugger 203(setup debugger
198 (:hook visual-line-mode) 204 (:hook visual-line-mode)
@@ -337,8 +343,7 @@
337 erc-fill-static-center 14 343 erc-fill-static-center 14
338 erc-format-nick-function #'erc-format-truncate-@nick 344 erc-format-nick-function #'erc-format-truncate-@nick
339 erc-header-line-face-method #'erc/update-header-line-show-disconnected 345 erc-header-line-face-method #'erc/update-header-line-show-disconnected
340 erc-hide-list '("NICK" "MODE" "JOIN" "NICK" "PART" "QUIT" 346 erc-hide-list '("NICK" "MODE" "JOIN" "PART" "QUIT")
341 "324" "329" "332" "333" "353" "477")
342 erc-interpret-controls-p t 347 erc-interpret-controls-p t
343 erc-interpret-mirc-color t 348 erc-interpret-mirc-color t
344 erc-join-buffer 'bury 349 erc-join-buffer 'bury
@@ -347,7 +352,7 @@
347 erc-kill-server-buffer-on-quit t 352 erc-kill-server-buffer-on-quit t
348 erc-nick "acdw" 353 erc-nick "acdw"
349 erc-nick-truncate (- erc-fill-static-center 1) 354 erc-nick-truncate (- erc-fill-static-center 1)
350 erc-prompt (lambda () (acdw-erc/prompt)) 355 erc-prompt #'acdw-erc/prompt
351 erc-prompt-for-password nil ; use ~/.authinfo 356 erc-prompt-for-password nil ; use ~/.authinfo
352 erc-rename-buffers t 357 erc-rename-buffers t
353 erc-server erc-default-server 358 erc-server erc-default-server
@@ -356,7 +361,8 @@
356 (mapcar #'car erc-autojoin-channels-alist)) 361 (mapcar #'car erc-autojoin-channels-alist))
357 erc-server-coding-system '(utf-8 . utf-8) 362 erc-server-coding-system '(utf-8 . utf-8)
358 erc-track-exclude-types (append erc-hide-list 363 erc-track-exclude-types (append erc-hide-list
359 '("AWAY")) 364 '("AWAY"
365 "353" "324" "329" "332" "333" "477"))
360 erc-track-exclude-server-buffer t 366 erc-track-exclude-server-buffer t
361 erc-track-position-in-mode-line 'before-modes 367 erc-track-position-in-mode-line 'before-modes
362 erc-track-visibility nil ; only the selected frame 368 erc-track-visibility nil ; only the selected frame
@@ -845,12 +851,6 @@ like a dumbass."
845 "M-u" upcase-dwim 851 "M-u" upcase-dwim
846 "M-l" downcase-dwim) 852 "M-l" downcase-dwim)
847 853
848 ;; (when (display-graphic-p)
849 ;; (:global "<escape>" keyboard-escape-quit))
850
851 ;; Remap C-h to DEL -- <f1> can be the "help" key
852 ;; (define-key key-translation-map [?\C-h] [?\C-?])
853
854 (:global "C-c t" acdw/insert-iso-date 854 (:global "C-c t" acdw/insert-iso-date
855 "C-z" nil)) 855 "C-z" nil))
856 856
@@ -939,7 +939,6 @@ if ripgrep is installed, otherwise `consult-grep'."
939 ;; C-x bindings (`ctl-x-map') 939 ;; C-x bindings (`ctl-x-map')
940 "C-x M-:" consult-complex-command 940 "C-x M-:" consult-complex-command
941 "C-x b" consult-buffer 941 "C-x b" consult-buffer
942 "<f1>" consult-buffer ; trying this out ...
943 "C-x 4 b" consult-buffer-other-window 942 "C-x 4 b" consult-buffer-other-window
944 "C-x 5 b" consult-buffer-other-frame 943 "C-x 5 b" consult-buffer-other-frame
945 ;; Custom M-# bindings for fast register access 944 ;; Custom M-# bindings for fast register access
@@ -1006,15 +1005,14 @@ if ripgrep is installed, otherwise `consult-grep'."
1006 (:advise completing-read-multiple 1005 (:advise completing-read-multiple
1007 :filter-args #'crm-indicator)) 1006 :filter-args #'crm-indicator))
1008 1007
1009 (with-eval-after-load 'vertico 1008 (with-eval-after-loads (vertico consult)
1010 (with-eval-after-load 'consult 1009 (when (boundp 'consult-crm-map)
1011 (when (boundp 'consult-crm-map) 1010 (define-key consult-crm-map "\r" #'+vertico-crm-exit)
1012 (define-key consult-crm-map "\r" #'+vertico-crm-exit) 1011 (define-key consult-crm-map "\t" #'vertico-exit)
1013 (define-key consult-crm-map "\t" #'vertico-exit) 1012 (defun +vertico-crm-exit ()
1014 (defun +vertico-crm-exit () 1013 (interactive)
1015 (interactive) 1014 (run-at-time 0 nil #'vertico-exit)
1016 (run-at-time 0 nil #'vertico-exit) 1015 (funcall #'vertico-exit)))))
1017 (funcall #'vertico-exit))))))
1018 1016
1019(setup (:straight crux) 1017(setup (:straight crux)
1020 1018
@@ -1086,11 +1084,10 @@ if ripgrep is installed, otherwise `consult-grep'."
1086 #'which-key--hide-popup-ignore-command) 1084 #'which-key--hide-popup-ignore-command)
1087 embark-become-indicator embark-action-indicator) 1085 embark-become-indicator embark-action-indicator)
1088 1086
1089 (with-eval-after-load 'embark 1087 (with-eval-after-loads (embark consult)
1090 (with-eval-after-load 'consult 1088 (setup (:straight embark-consult)
1091 (setup (:straight embark-consult) 1089 (add-hook 'embark-collect-mode-hook
1092 (add-hook 'embark-collect-mode-hook 1090 #'consult-preview-at-point-mode))))
1093 #'consult-preview-at-point-mode)))))
1094 1091
1095(setup (:straight epithet) 1092(setup (:straight epithet)
1096 (add-hook 'Info-selection-hook #'epithet-rename-buffer) 1093 (add-hook 'Info-selection-hook #'epithet-rename-buffer)
@@ -1201,6 +1198,7 @@ if ripgrep is installed, otherwise `consult-grep'."
1201(setup (:straight (mastodon 1198(setup (:straight (mastodon
1202 :host github 1199 :host github
1203 :repo "mooseyboots/mastodon.el")) 1200 :repo "mooseyboots/mastodon.el"))
1201 (:straight request)
1204 (:option mastodon-instance-url "https://writing.exchange" 1202 (:option mastodon-instance-url "https://writing.exchange"
1205 mastodon-auth-source-file (car auth-sources) 1203 mastodon-auth-source-file (car auth-sources)
1206 mastodon-client--token-file (acdw/dir "mastodon.plstore"))) 1204 mastodon-client--token-file (acdw/dir "mastodon.plstore")))
@@ -1301,35 +1299,39 @@ if ripgrep is installed, otherwise `consult-grep'."
1301(setup (:straight org) 1299(setup (:straight org)
1302 (:straight org-contrib) 1300 (:straight org-contrib)
1303 (require 'acdw-org) ; so I don't clutter up init.el 1301 (require 'acdw-org) ; so I don't clutter up init.el
1304 (:option org-adapt-indentation nil 1302 (:option
1305 org-catch-invisible-edits 'smart 1303 org-adapt-indentation nil
1306 org-clock-clocked-in-display 'mode-line 1304 org-catch-invisible-edits 'smart
1307 org-clock-string-limit 7 ; gives time and not title 1305 org-clock-clocked-in-display 'mode-line
1308 org-confirm-babel-evaluate nil 1306 org-clock-string-limit 7 ; gives time and not title
1309 org-ellipsis " …" 1307 org-confirm-babel-evaluate nil
1310 org-export-coding-system 'utf-8-unix 1308 org-directory "~/org"
1311 org-export-headline-levels 8 1309 org-ellipsis " …"
1312 org-export-with-section-numbers nil 1310 org-export-coding-system 'utf-8-unix
1313 org-export-with-smart-quotes t 1311 org-export-headline-levels 8
1314 org-export-with-sub-superscripts t 1312 org-export-with-section-numbers nil
1315 org-export-with-toc nil 1313 org-export-with-smart-quotes t
1316 org-fontify-done-headline t 1314 org-export-with-sub-superscripts t
1317 org-fontify-quote-and-verse-blocks t 1315 org-export-with-toc nil
1318 org-fontify-whole-heading-line t 1316 org-fontify-done-headline t
1319 org-hide-emphasis-markers t 1317 org-fontify-quote-and-verse-blocks t
1320 org-html-coding-system 'utf-8-unix 1318 org-fontify-whole-heading-line t
1321 org-imenu-depth 3 1319 org-hide-emphasis-markers t
1322 org-outline-path-complete-in-steps nil 1320 org-html-coding-system 'utf-8-unix
1323 org-pretty-entities t 1321 org-image-actual-width '(300)
1324 org-refile-use-outline-path 'file 1322 org-imenu-depth 3
1325 org-special-ctrl-a/e t 1323 org-outline-path-complete-in-steps nil
1326 org-special-ctrl-k t 1324 org-pretty-entities t
1327 org-src-fontify-natively t 1325 org-refile-use-outline-path 'file
1328 org-src-tab-acts-natively t 1326 org-special-ctrl-a/e t
1329 org-src-window-setup 'current-window 1327 org-special-ctrl-k t
1330 org-startup-truncated nil 1328 org-src-fontify-natively t
1331 org-tags-column 0 ; (- 0 fill-column -3) 1329 org-src-tab-acts-natively t
1332 org-directory "~/org") 1330 org-src-window-setup 'current-window
1331 org-startup-truncated nil
1332 org-startup-with-inline-images t
1333 org-tags-column 0 ; (- 0 fill-column -3)
1334 )
1333 1335
1334 (:bind "RET" acdw-org/return-dwim 1336 (:bind "RET" acdw-org/return-dwim
1335 "<S-return>" acdw-org/org-table-copy-down 1337 "<S-return>" acdw-org/org-table-copy-down
@@ -1348,7 +1350,10 @@ if ripgrep is installed, otherwise `consult-grep'."
1348 acdw/org-fix-lines-before-save) 1350 acdw/org-fix-lines-before-save)
1349 1351
1350 (advice-add 'org-delete-backward-char 1352 (advice-add 'org-delete-backward-char
1351 :override #'acdw-org/delete-backward-char)) 1353 :override #'acdw-org/delete-backward-char)
1354
1355 (setup (:straight org-appear)
1356 (:hook-into org-mode)))
1352 1357
1353(setup (:straight paredit) 1358(setup (:straight paredit)
1354 1359
@@ -1463,6 +1468,8 @@ if ripgrep is installed, otherwise `consult-grep'."
1463 1468
1464 (global-undo-fu-session-mode +1)) 1469 (global-undo-fu-session-mode +1))
1465 1470
1471(setup (:straight unfill))
1472
1466(setup (:straight (unfocused 1473(setup (:straight (unfocused
1467 :host github 1474 :host github
1468 :repo "duckwork/unfocused")) 1475 :repo "duckwork/unfocused"))