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.el554
1 files changed, 368 insertions, 186 deletions
diff --git a/init.el b/init.el index c8fb4e7..d6363ea 100644 --- a/init.el +++ b/init.el
@@ -22,18 +22,39 @@
22(use-package emacs ; Misc. config 22(use-package emacs ; Misc. config
23 :config 23 :config
24 (setopt recenter-positions '(top middle bottom) 24 (setopt recenter-positions '(top middle bottom)
25 initial-scratch-message 25 initial-major-mode 'lisp-interaction-mode
26 (format "%s\n\n" 26 initial-scratch-message ";; Emacs!\n\n"
27 (mapconcat (lambda (s) (format ";; %s" s)) 27 ;; (format "%s\n\n"
28 (process-lines "fortune" "-s") 28 ;; (mapconcat (lambda (s) (format ";; %s" s))
29 "\n"))) 29 ;; (process-lines "fortune" "-s")
30 ;; "\n"))
31 eval-expression-print-level nil
32 eval-expression-print-length nil
33 x-select-enable-clipboard-manager nil)
34 ;; TODO: move this ... elsewhere
35 (setopt mode-line-format
36 '("%e"
37 mode-line-front-space
38 ;; (:propertize ("" mode-line-mule-info
39 ;; mode-line-client
40 ;; mode-line-modified
41 ;; mode-line-remote)
42 ;; display (min-width (5.0)))
43 ("" mode-line-mule-info
44 mode-line-client
45 mode-line-modified
46 mode-line-remote)
47 mode-line-frame-identification
48 mode-line-buffer-identification
49 " "
50 mode-line-position
51 (vc-mode vc-mode)
52 " "
53 minions-mode-line-modes
54 mode-line-misc-info
55 mode-line-end-spaces))
30 (keymap-global-unset "C-\\") 56 (keymap-global-unset "C-\\")
31 (keymap-global-unset "<f2>") 57 (keymap-global-unset "<f2>")
32 (add-hook 'kill-buffer-query-functions
33 (defun scratch@immortal ()
34 (if (equal (buffer-name) "*scratch*")
35 (progn (bury-buffer) nil)
36 t)))
37 (setf (alist-get "\\*Compile-Log\\*" display-buffer-alist nil nil #'equal) 58 (setf (alist-get "\\*Compile-Log\\*" display-buffer-alist nil nil #'equal)
38 '(display-buffer-no-window)) 59 '(display-buffer-no-window))
39 (add-hook 'after-init-hook 60 (add-hook 'after-init-hook
@@ -61,20 +82,28 @@
61 (defun first-frame@set-fonts () 82 (defun first-frame@set-fonts ()
62 (remove-hook 'server-after-make-frame-hook 83 (remove-hook 'server-after-make-frame-hook
63 #'first-frame@set-fonts) 84 #'first-frame@set-fonts)
64 (face-spec-set 'fixed-pitch
65 `((t :family ,(find-font "Comic Code"
66 "DejaVu Sans Mono")
67 :height 100)))
68 (face-spec-set 'variable-pitch
69 `((t :family ,(find-font "Atkinson Hyperlegible"
70 "DejaVu Serif")
71 :height 1.4)))
72 (face-spec-set 'default 85 (face-spec-set 'default
73 `((t :family ,(find-font "Comic Code" 86 `((t :family ,(find-font
74 "DejaVu Sans Mono") 87 "Recursive Mono Casual Static"
88 "Comic Code"
89 "DejaVu Sans Mono")
75 :height 100))) 90 :height 100)))
91 (face-spec-set 'fixed-pitch
92 `((t :family ,(find-font
93 "Recursive Mono Casual Static"
94 "Comic Code"
95 "DejaVu Sans Mono")
96 :height 1.0)))
97 (face-spec-set 'variable-pitch
98 `((t :family ,(find-font
99 "Recursive Sans Linear Static"
100 "Atkinson Hyperlegible"
101 "DejaVu Serif")
102 :height 1.0)))
76 (face-spec-set 'font-lock-comment-face 103 (face-spec-set 'font-lock-comment-face
77 `((t :slant italic))) 104 `((t :inherit variable-pitch)))
105 (face-spec-set 'font-lock-string-face
106 `((t :inherit variable-pitch)))
78 ;; Emojis 107 ;; Emojis
79 (cl-loop with ffl = (font-family-list) 108 (cl-loop with ffl = (font-family-list)
80 for font in '("Noto Emoji" "Noto Color Emoji" 109 for font in '("Noto Emoji" "Noto Color Emoji"
@@ -85,27 +114,28 @@
85 do (set-fontset-font t 'symbol font)) 114 do (set-fontset-font t 'symbol font))
86 ;; International scripts 115 ;; International scripts
87 (cl-loop with ffl = (font-family-list) 116 (cl-loop with ffl = (font-family-list)
88 for (charset . font) in '((latin . "Noto Sans") 117 for (charset . font)
89 (han . "Noto Sans CJK SC Regular") 118 in '((latin . "Noto Sans")
90 (kana . "Noto Sans CJK JP Regular") 119 (han . "Noto Sans CJK SC Regular")
91 (hangul . "Noto Sans CJK KR Regular") 120 (kana . "Noto Sans CJK JP Regular")
92 (cjk-misc . "Noto Sans CJK KR Regular") 121 (hangul . "Noto Sans CJK KR Regular")
93 (khmer . "Noto Sans Khmer") 122 (cjk-misc . "Noto Sans CJK KR Regular")
94 (lao . "Noto Sans Lao") 123 (khmer . "Noto Sans Khmer")
95 (burmese . "Noto Sans Myanmar") 124 (lao . "Noto Sans Lao")
96 (thai . "Noto Sans Thai") 125 (burmese . "Noto Sans Myanmar")
97 (ethiopic . "Noto Sans Ethiopic") 126 (thai . "Noto Sans Thai")
98 (hebrew . "Noto Sans Hebrew") 127 (ethiopic . "Noto Sans Ethiopic")
99 (arabic . "Noto Sans Arabic") 128 (hebrew . "Noto Sans Hebrew")
100 (gujarati . "Noto Sans Gujarati") 129 (arabic . "Noto Sans Arabic")
101 (devanagari . "Noto Sans Devanagari") 130 (gujarati . "Noto Sans Gujarati")
102 (kannada . "Noto Sans Kannada") 131 (devanagari . "Noto Sans Devanagari")
103 (malayalam . "Noto Sans Malayalam") 132 (kannada . "Noto Sans Kannada")
104 (oriya . "Noto Sans Oriya") 133 (malayalam . "Noto Sans Malayalam")
105 (sinhala . "Noto Sans Sinhala") 134 (oriya . "Noto Sans Oriya")
106 (tamil . "Noto Sans Tamil") 135 (sinhala . "Noto Sans Sinhala")
107 (telugu . "Noto Sans Telugu") 136 (tamil . "Noto Sans Tamil")
108 (tibetan . "Noto Sans Tibetan")) 137 (telugu . "Noto Sans Telugu")
138 (tibetan . "Noto Sans Tibetan"))
109 if (member font ffl) 139 if (member font ffl)
110 do (set-fontset-font t charset font)))) 140 do (set-fontset-font t charset font))))
111 (unless (daemonp) 141 (unless (daemonp)
@@ -142,14 +172,11 @@
142(use-package ispell 172(use-package ispell
143 :config 173 :config
144 (setopt ispell-program-name (choose-executable "aspell" "ispell")) 174 (setopt ispell-program-name (choose-executable "aspell" "ispell"))
145 (add-hook 'before-save-hook 175 ;; (add-hook 'before-save-hook
146 #'+ispell-move-buffer-words-to-dir-locals-hook) 176 ;; #'+ispell-move-buffer-words-to-dir-locals-hook)
147 (put 'ispell-buffer-session-localwords 'safe-local-variable 177 (put 'ispell-buffer-session-localwords 'safe-local-variable
148 '+ispell-safe-local-p)) 178 '+ispell-safe-local-p))
149 179
150(use-package flyspell
151 :hook org-mode-hook)
152
153(use-package dired 180(use-package dired
154 :bind (("C-x C-j" . dired-jump) 181 :bind (("C-x C-j" . dired-jump)
155 ([remap list-directory] . dired) 182 ([remap list-directory] . dired)
@@ -186,7 +213,16 @@
186 "localhost" 213 "localhost"
187 "dict.org")) 214 "dict.org"))
188 :bind 215 :bind
189 (("C-c d" . dictionary-search))) 216 (("C-c w d" . dictionary-search))
217 :config
218 (setf (alist-get "\\*Dictionary\\*" display-buffer-alist nil nil #'equal)
219 '(display-buffer-in-side-window
220 (window-width . 80)
221 (side . right))))
222
223(use-package calendar
224 :custom
225 (diary-file (private/ "diary")))
190 226
191(use-package mouse 227(use-package mouse
192 :config 228 :config
@@ -261,9 +297,12 @@
261 ;; https://www.masteringemacs.org/article/seamlessly-merge-multiple-documentation-sources-eldoc 297 ;; https://www.masteringemacs.org/article/seamlessly-merge-multiple-documentation-sources-eldoc
262 (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)) 298 (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly))
263 :hook 299 :hook
264 ((bash-ts-mode . eglot)) 300 ((bash-ts-mode . eglot-ensure)
301 (scheme-mode . eglot-ensure))
265 :config 302 :config
266 (add-hook 'eglot-managed-mode . +eglot-eldoc)) 303 (add-to-list 'eglot-server-programs
304 '(scheme-mode . ("chicken-lsp-server")))
305 (add-hook 'eglot-managed-mode #'+eglot-eldoc))
267 306
268(use-package eldoc 307(use-package eldoc
269 :config 308 :config
@@ -273,6 +312,76 @@
273 (window-height . 4))) 312 (window-height . 4)))
274 (eldoc-add-command-completions "paredit-")) 313 (eldoc-add-command-completions "paredit-"))
275 314
315(use-package pulse
316 :config
317 (setopt pulse-flag nil
318 pulse-delay 1
319 pulse-iterations 1))
320
321(use-package flyspell
322 :hook (org-mode-hook))
323
324(use-package display-fill-column-indicator
325 :hook (prog-mode-hook))
326
327(use-package package
328 :config
329 (defun package-update-async-in-progress (&rest _)
330 (message "Package async update in progress."))
331
332 (defun package-update-all-async ()
333 "Update packages asyncronously."
334 (interactive)
335 (let ((message "Package update (async)...")
336 (disable-fns '(package-update
337 package-update-all
338 package-update-all-async)))
339 (dolist (fn disable-fns)
340 (advice-add fn :override #'package-update-async-in-progress))
341 (message "%s" message)
342 (unwind-protect
343 (async-start
344 `(lambda ()
345 (package-initialize)
346 (package-update-all))
347 `(lambda (result)
348 (message "%s %s" ,message result)))
349 (dolist (fn ',disable-fns)
350 (advice-remove fn 'package-update-async-in-progress))))))
351
352(use-package ielm
353 ;; https://www.n16f.net/blog/making-ielm-more-comfortable/
354 :preface
355 (defun +ielm-init-history ()
356 (let ((path (etc/ "ielm/history" t)))
357 (setq-local comint-input-ring-file-name path))
358 (setq-local comint-input-ring-size 10000)
359 (setq-local comint-input-ignoredups t)
360 (ignore-errors (comint-read-input-ring)))
361 (defun +ielm-write-history (&rest _args)
362 (with-file-modes #o600
363 (comint-write-input-ring)))
364 (defun +ielm (&optional buf-name)
365 "Interactively evaluate Emacs Lisp expressions.
366Switches to the buffer named BUF-NAME if provided (`*ielm*' by default),
367or creates it if it does not exist.
368See `inferior-emacs-lisp-mode' for details."
369 (interactive)
370 (let (old-point
371 (buf-name (or buf-name "*ielm*")))
372 (unless (comint-check-proc buf-name)
373 (with-current-buffer (get-buffer-create buf-name)
374 (unless (zerop (buffer-size)) (setq old-point (point)))
375 (inferior-emacs-lisp-mode)))
376 (pop-to-buffer buf-name)
377 (when old-point (push-mark old-point))))
378 :bind (:map emacs-lisp-mode-map
379 ("C-c C-z" . +ielm))
380 :config
381 (add-hook 'ielm-mode-hook #'eldoc-mode)
382 (add-hook 'ielm-mode-hook #'+ielm-init-history)
383 (advice-add 'ielm-send-input :after #'+ielm-write-history))
384
276 385
277;;; Applications 386;;; Applications
278 387
@@ -282,7 +391,9 @@
282 :bind (("C-c n" . +notmuch-goto))) 391 :bind (("C-c n" . +notmuch-goto)))
283 392
284(use-package acdw-org 393(use-package acdw-org
285 :load-path "lisp/") 394 :load-path "lisp/"
395 :config
396 (global-set-key [f8] #'org-clock-out))
286 397
287(use-package acdw-shell 398(use-package acdw-shell
288 :load-path "lisp/") 399 :load-path "lisp/")
@@ -290,12 +401,33 @@
290(use-package acdw-web 401(use-package acdw-web
291 :load-path "lisp/") 402 :load-path "lisp/")
292 403
404(use-package acdw-chat
405 :load-path "lisp/")
406
293(use-package _work 407(use-package _work
294 :load-path "~/Sync/emacs/private/") 408 :load-path "~/sync/emacs/private/")
295 409
296 410
297;;; Locally-developed packages 411;;; Locally-developed packages
298 412
413(use-package +scratch
414 :load-path "lisp/"
415 :config
416 (setopt +scratch-save-dir (sync/ "emacs/scratch.d/" t))
417 (add-hook 'kill-buffer-query-functions #'+scratch@immortal)
418 (add-hook 'kill-emacs-hook #'+scratch-save-on-exit)
419 (with-current-buffer (get-scratch-buffer-create)
420 (local-set-key (kbd "C-x C-s") #'+scratch-save))
421 ;; Save *scratch* every hour
422 (run-at-time t (* 60 60) #'+scratch-save "%FT%H%z")
423 ;; Clean old *scratch* saves every day
424 (run-at-time t (* 60 60 24) #'+scratch-clean))
425
426(use-package pulse-location
427 :load-path "~/src/emacs/pulse-location/"
428 :config
429 (pulse-location-mode))
430
299(use-package dawn 431(use-package dawn
300 :load-path "~/src/emacs/dawn/" 432 :load-path "~/src/emacs/dawn/"
301 :after custom-allowed 433 :after custom-allowed
@@ -303,7 +435,41 @@
303 (add-hook 'custom-allowed-after-load-hook 435 (add-hook 'custom-allowed-after-load-hook
304 (defun dawn-modus () 436 (defun dawn-modus ()
305 (dawn-schedule-themes 'modus-operandi 437 (dawn-schedule-themes 'modus-operandi
306 'modus-vivendi)))) 438 'modus-vivendi)))
439 (setopt modus-themes-mixed-fonts t)
440 (load-theme 'modus-vivendi t)
441 (add-hook 'dawn-after-load-theme-hook
442 (defun +reset-faces ()
443 (dolist (face '(font-lock-regexp-face
444 font-lock-variable-name-face
445 font-lock-preprocessor-face
446 font-lock-remove-face
447 font-lock-delimiter-face
448 font-lock-label-face
449 font-lock-operator-face
450 font-lock-property-face
451 font-lock-builtin-face
452 font-lock-number-face
453 font-lock-set-face
454 font-lock-warning-face
455 font-lock-punctuation-face
456 font-lock-constant-face
457 font-lock-type-face
458 font-lock-function-name-face
459 font-lock-reference-face
460 font-lock-negation-char-face
461 font-lock-misc-punctuation-face
462 font-lock-escape-face
463 font-lock-bracket-face))
464 (face-spec-set face '((t :foreground unspecified
465 :background unspecified))))
466 (face-spec-set 'font-lock-keyword-face
467 '((t :foreground unspecified
468 :background unspecified
469 :weight bold)))
470 (face-spec-set 'font-lock-doc-face
471 '((t :slant italic)))))
472 (+reset-faces))
307 473
308(use-package electric-cursor 474(use-package electric-cursor
309 :load-path "~/src/emacs/electric-cursor/" 475 :load-path "~/src/emacs/electric-cursor/"
@@ -345,18 +511,13 @@ With prefix ARG, toggle the value of
345 (titlecase-region (progn (org-beginning-of-line) (point)) 511 (titlecase-region (progn (org-beginning-of-line) (point))
346 (progn (org-end-of-line) (point))))))) 512 (progn (org-end-of-line) (point)))))))
347 :config 513 :config
348 (keymap-set scule-map "M-t" #'titlecase-dwim)) 514 (with-eval-after-load 'scule
515 (keymap-set scule-map "M-t" #'titlecase-dwim)))
349 516
350(use-package scule 517(use-package scule
351 :load-path "~/src/emacs/scule/" 518 :load-path "~/src/emacs/scule/"
352 :config 519 :bind-keymap ("M-c" . scule-map)
353 (defvar-keymap scule-map 520 :init
354 :doc "Keymap to twiddle scules."
355 :repeat t ; TODO: doesn't work
356 "M-u" #'scule-upcase
357 "M-l" #'scule-downcase
358 "M-c" #'scule-capitalize)
359 (keymap-global-set "M-c" scule-map)
360 ;; Use M-u for prefix keys 521 ;; Use M-u for prefix keys
361 (keymap-global-set "M-u" #'universal-argument) 522 (keymap-global-set "M-u" #'universal-argument)
362 (keymap-set universal-argument-map "M-u" #'universal-argument-more)) 523 (keymap-set universal-argument-map "M-u" #'universal-argument-more))
@@ -372,111 +533,6 @@ With prefix ARG, toggle the value of
372 :config 533 :config
373 (global-frowny-mode)) 534 (global-frowny-mode))
374 535
375(use-package jabber
376 :load-path "~/src/emacs/jabber/"
377 :preface
378 (defvar jabber-prefix-width 10
379 "Width of jabber prompts and other prefixes.")
380 (defun jabber-ui-setup ()
381 "Setup the `jabber' user interface."
382 (visual-fill-column-mode)
383 (electric-pair-local-mode -1)
384 (auto-fill-mode -1)
385 (setq-local wrap-prefix (make-string (+ 3 jabber-prefix-width) #x20)
386 visual-fill-column-extra-text-width `(,(+ 3 jabber-prefix-width)
387 . 1)))
388 :custom-face
389 (jabber-activity-face ((t :inherit jabber-chat-prompt-foreign
390 :foreground unspecified
391 :weight normal)))
392 (jabber-activity-personal-face ((t :inherit jabber-chat-prompt-local
393 :foreground unspecified
394 :weight bold)))
395 (jabber-chat-prompt-local ((t :inherit font-lock-warning-face
396 :foreground unspecified)))
397 (jabber-chat-prompt-foreign ((t :inherit font-lock-constant-face
398 :foreground unspecified)))
399 (jabber-chat-prompt-system ((t :inherit font-lock-doc-face
400 :foreground unspecified)))
401 (jabber-rare-time-face ((t :inherit font-lock-comment-face
402 :foreground unspecified
403 :underline nil)))
404 :bind-keymap ("C-c j" . jabber-global-keymap)
405 :bind (("C-c C-SPC" . jabber-activity-switch-to))
406 :config
407 (setopt jabber-account-list '(("acdw@hmm.st"))
408 jabber-auto-reconnect t
409 jabber-last-read-marker (make-string (- fill-column 8) ?—)
410 jabber-muc-decorate-presence-patterns
411 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$" . nil)
412 ("Mode #.*" . jabber-muc-presence-dim)
413 ("." . jabber-muc-presence-dim))
414 jabber-activity-make-strings #'jabber-activity-make-strings-shorten
415 jabber-rare-time-format " - - - - - - %H:%M %F"
416 jabber-muc-header-line-format
417 '(" " (:eval (replace-regexp-in-string "%" "%%"
418 (jabber-jid-displayname
419 jabber-group)))
420 " / " jabber-muc-topic)
421 ;; buffer name formats
422 jabber-chat-buffer-format "*xmpp* %n"
423 jabber-browse-buffer-format "*xmpp-browse* %n"
424 jabber-groupchat-buffer-format "*xmpp-muc* %n"
425 jabber-muc-private-buffer-format "*xmpp-muc-private* %n"
426 ;; "prompt" (speaker) formats
427 jabber-groupchat-prompt-format (format "%%>%dn | " jabber-prefix-width)
428 jabber-chat-local-prompt-format (format "%%>%dn | " jabber-prefix-width)
429 jabber-chat-foreign-prompt-format (format "%%>%dn | " jabber-prefix-width)
430 jabber-muc-private-foreign-prompt-format "\n%g/%n | ")
431 ;; jabber muc nick coloring
432 ;; wgreenhous | I found 1.5 ok for saturation and 2.0 for value (modus)
433 ;; (setopt jabber-muc-nick-value 1.0
434 ;; jabber-muc-nick-saturation 1.0
435 ;; jabber-muc-colorize-local t
436 ;; jabber-muc-colorize-foreign t)
437 ;; When changing the above values, make sure to
438 ;; (setq jabber-muc-participant-colors nil)
439 (add-hook 'jabber-chat-mode-hook #'jabber-ui-setup)
440 (keymap-global-set "C-x C-j" #'dired-jump) ; Extremely annoying fix
441 (require 'jabber-httpupload nil t)
442 (add-hook 'jabber-post-connect-hooks #'jabber-enable-carbons)
443 (remove-hook 'jabber-alert-muc-hooks 'jabber-muc-echo)
444 (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)
445 (add-hook 'jabber-alert-muc-hooks
446 (defun jabber@highlight-acdw (&optional _ _ buf _ _)
447 (when buf
448 (with-current-buffer buf
449 (let ((regexp (rx word-boundary
450 "acdw" ; maybe get from the config?
451 word-boundary)))
452 (hi-lock-unface-buffer regexp)
453 (highlight-regexp regexp 'font-lock-warning-face))))))
454 (add-hook 'jabber-chat-mode-hook
455 (defun jabber-chat@leave-when-kill ()
456 (add-hook 'kill-buffer-hook
457 (defun @jabber-leave@kill ()
458 (ignore-errors
459 (apply #'jabber-muc-leave (jabber-muc-argument-list))))
460 nil :local)))
461 (when (fboundp 'jabber-chat-update-focus)
462 (add-hook 'window-configuration-change-hook #'jabber-chat-update-focus))
463 (with-eval-after-load 'consult
464 (defvar jabber-chat-buffer-source
465 `( :name "Jabber"
466 :hidden nil
467 :narrow ?j
468 :category buffer
469 :state ,#'consult--buffer-state
470 :items ,(lambda ()
471 (mapcar #'buffer-name
472 (seq-filter (lambda (buf)
473 (with-current-buffer buf
474 (eq major-mode 'jabber-chat-mode)))
475 (buffer-list))))))
476 (add-to-list 'consult-buffer-sources 'jabber-chat-buffer-source :append)
477 (consult-customize
478 consult-buffer :preview-key "M-.")))
479
480(use-package keepassxc-shim 536(use-package keepassxc-shim
481 :load-path "~/src/emacs/keepassxc-shim/" 537 :load-path "~/src/emacs/keepassxc-shim/"
482 :config 538 :config
@@ -502,7 +558,7 @@ With prefix ARG, toggle the value of
502 558
503(use-package form-feed 559(use-package form-feed
504 :ensure t 560 :ensure t
505 :hook (emacs-lisp-mode-hook)) 561 :hook (prog-mode-hook))
506 562
507(use-package clean-kill-ring 563(use-package clean-kill-ring
508 :vc (:url "https://github.com/NicholasBHubbard/clean-kill-ring.el") 564 :vc (:url "https://github.com/NicholasBHubbard/clean-kill-ring.el")
@@ -548,10 +604,11 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
548 (visual-fill-column-adjust) 604 (visual-fill-column-adjust)
549 (message "Fill-column: %s" fill-column))) 605 (message "Fill-column: %s" fill-column)))
550 :ensure t 606 :ensure t
551 :init
552 (setopt visual-fill-column-center-text t
553 visual-fill-column-extra-text-width '(3 . 3))
554 :config 607 :config
608 (setopt visual-fill-column-center-text t
609 visual-fill-column-extra-text-width '(3 . 3)
610 visual-fill-column-width (+ fill-column 4))
611 (keymap-set toggle-map "v" #'visual-fill-column-mode)
555 (keymap-set visual-fill-column-mode-map "C-x C->" #'visual-fill-column-widen) 612 (keymap-set visual-fill-column-mode-map "C-x C->" #'visual-fill-column-widen)
556 (keymap-set visual-fill-column-mode-map "C-x C-<" #'visual-fill-column-narrow) 613 (keymap-set visual-fill-column-mode-map "C-x C-<" #'visual-fill-column-narrow)
557 (add-hook 'visual-fill-column-mode-hook #'visual-line-mode) 614 (add-hook 'visual-fill-column-mode-hook #'visual-line-mode)
@@ -590,12 +647,12 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
590 647
591(use-package avy 648(use-package avy
592 :ensure t 649 :ensure t
593 :init
594 (setopt avy-background t
595 avy-keys (string-to-list "asdfghjklqwertyuiopzxcvbnm"))
596 :bind (("M-j" . avy-goto-char-timer) 650 :bind (("M-j" . avy-goto-char-timer)
597 :map isearch-mode-map 651 :map isearch-mode-map
598 ("M-j" . avy-isearch))) 652 ("M-j" . avy-isearch))
653 :config
654 (setopt avy-background t
655 avy-keys (string-to-list "asdfghjklqwertyuiopzxcvbnm")))
599 656
600(use-package zzz-to-char 657(use-package zzz-to-char
601 :ensure t 658 :ensure t
@@ -660,8 +717,9 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
660 (call-interactively 717 (call-interactively
661 (if (derived-mode-p 'lisp-interaction-mode) 718 (if (derived-mode-p 'lisp-interaction-mode)
662 #'eval-print-last-sexp #'paredit-newline)))) 719 #'eval-print-last-sexp #'paredit-newline))))
663 (keymap-set paredit-mode-map "RET" nil) 720 (keymap-unset paredit-mode-map "RET" t)
664 (keymap-set paredit-mode-map "M-s" nil) 721 (keymap-unset paredit-mode-map "M-s" t)
722 (keymap-unset paredit-mode-map "M-r" t)
665 (add-to-list 'paredit-space-for-delimiter-predicates 723 (add-to-list 'paredit-space-for-delimiter-predicates
666 (defun paredit@dont-space-@ (endp delimiter) 724 (defun paredit@dont-space-@ (endp delimiter)
667 "Don't add a space after @ in `paredit-mode'." 725 "Don't add a space after @ in `paredit-mode'."
@@ -717,10 +775,9 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
717 775
718(use-package sly 776(use-package sly
719 :ensure t 777 :ensure t
778 :when inferior-lisp-program
720 :preface 779 :preface
721 (setopt inferior-lisp-program (choose-executable "sbcl")) 780 (setopt inferior-lisp-program (choose-executable "sbcl"))
722 :when inferior-lisp-program
723 :init
724 (defun +sly-start-or-mrepl () 781 (defun +sly-start-or-mrepl ()
725 (interactive) 782 (interactive)
726 (if (ignore-errors (sly-connection)) 783 (if (ignore-errors (sly-connection))
@@ -754,7 +811,11 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
754 "\\.erb\\'" 811 "\\.erb\\'"
755 "\\.mustache\\'" 812 "\\.mustache\\'"
756 "\\.djhtml\\'" 813 "\\.djhtml\\'"
757 "\\.html?\\'")) 814 "\\.html?\\'")
815 :config
816 (add-hook 'web-mode-hook
817 (defun web-mode@setup ()
818 (indent-tabs-mode -1))))
758 819
759(use-package nginx-mode 820(use-package nginx-mode
760 :ensure t 821 :ensure t
@@ -775,6 +836,7 @@ The prefix argument is as in `visual-fill-column-widen' but negated."
775 (pandoc-mode-hook . pandoc-load-default-settings))) 836 (pandoc-mode-hook . pandoc-load-default-settings)))
776 837
777(use-package edit-indirect 838(use-package edit-indirect
839 :ensure
778 :bind (("C-c '" . edit-indirect-region))) 840 :bind (("C-c '" . edit-indirect-region)))
779 841
780(use-package transpose-frame 842(use-package transpose-frame
@@ -842,9 +904,9 @@ With PREFIX, prompt to change the current dictionary."
842 (call-interactively #'ispell-change-dictionary))) 904 (call-interactively #'ispell-change-dictionary)))
843 (flyspell-correct-move (point-min) :forward :rapid)) 905 (flyspell-correct-move (point-min) :forward :rapid))
844 :after flyspell 906 :after flyspell
845 :bind (:map flyspell-mode-map 907 :bind (("<f7>" . +flyspell-correct-buffer)
846 ("C-;" . flyspell-correct-wrapper) 908 (:map flyspell-mode-map
847 ("<f7>" . +flyspell-correct-buffer)) 909 ("C-;" . flyspell-correct-wrapper)))
848 :config 910 :config
849 (setq flyspell-correct--cr-key ";") 911 (setq flyspell-correct--cr-key ";")
850 (keymap-unset flyspell-mode-map "C-," t) 912 (keymap-unset flyspell-mode-map "C-," t)
@@ -871,6 +933,10 @@ With PREFIX, prompt to change the current dictionary."
871 :config 933 :config
872 (setopt dgi-auto-hide-details-p nil)) 934 (setopt dgi-auto-hide-details-p nil))
873 935
936(use-package expand-region ; needed for embrace anyway
937 :ensure t
938 :bind (("C-=" . er/expand-region)))
939
874(use-package embrace 940(use-package embrace
875 :ensure t 941 :ensure t
876 :preface 942 :preface
@@ -961,10 +1027,25 @@ With PREFIX, prompt to change the current dictionary."
961;; (setq start (point))) 1027;; (setq start (point)))
962;; (scheme-send-region-and-go start end)))))) 1028;; (scheme-send-region-and-go start end))))))
963 1029
964(use-package geiser-guile ; Let's try using guile instead 1030(use-package geiser
965 :ensure t 1031 :ensure t
966 :config 1032 :config
967 (keymap-unset scheme-mode-map "M-o" t)) 1033 (use-package geiser-guile :ensure t)
1034 (use-package geiser-chicken :ensure t)
1035 (use-package geiser-chez :ensure t)
1036 (use-package geiser-gambit :ensure t)
1037 (use-package geiser-chibi :ensure t)
1038 (use-package macrostep-geiser
1039 :ensure t
1040 :config
1041 (eval-after-load 'geiser-mode
1042 '(add-hook 'geiser-mode-hook #'macrostep-geiser-setup))
1043 (eval-after-load 'geiser-repl
1044 '(add-hook 'geiser-repl-mode-hook #'macrostep-geiser-setup)))
1045 (with-eval-after-load 'geiser-mode
1046 (keymap-set geiser-mode-map "C-c C-k" #'geiser-eval-buffer-and-go)
1047 (keymap-unset geiser-mode-map "C-." t)
1048 (keymap-unset scheme-mode-map "M-o" t)))
968 1049
969(use-package treesit-auto 1050(use-package treesit-auto
970 ;; XXX: I don't really get the utility of this package, but I spent a ton of 1051 ;; XXX: I don't really get the utility of this package, but I spent a ton of
@@ -984,7 +1065,8 @@ With PREFIX, prompt to change the current dictionary."
984(use-package detached 1065(use-package detached
985 :when (executable-find "dtach") 1066 :when (executable-find "dtach")
986 :ensure t 1067 :ensure t
987 :init (detached-init) 1068 :init
1069 (add-hook 'after-init-hook #'detached-init)
988 :bind (([remap async-shell-command] . detached-shell-command) 1070 :bind (([remap async-shell-command] . detached-shell-command)
989 ([remap compile] . detached-compile) 1071 ([remap compile] . detached-compile)
990 ([remap recompile] . detached-compile-recompile)) 1072 ([remap recompile] . detached-compile-recompile))
@@ -992,3 +1074,103 @@ With PREFIX, prompt to change the current dictionary."
992 (setf detached-terminal-data-command system-type) 1074 (setf detached-terminal-data-command system-type)
993 (with-eval-after-load 'consult 1075 (with-eval-after-load 'consult
994 (global-set-key [remap detached-open-session] #'detached-consult-session))) 1076 (global-set-key [remap detached-open-session] #'detached-consult-session)))
1077
1078(use-package lin
1079 :ensure t
1080 :config
1081 (setopt lin-face 'lin-cyan
1082 lin-mode-hooks
1083 '(dired-mode-hook
1084 ;; bongo-mode-hook
1085 ;; elfeed-search-mode-hook
1086 git-rebase-mode-hook
1087 grep-mode-hook
1088 ibuffer-mode-hook
1089 ilist-mode-hook
1090 ;; ledger-report-mode-hook
1091 log-view-mode-hook
1092 magit-log-mode-hook
1093 ;; mu4e-headers-mode-hook
1094 notmuch-search-mode-hook
1095 notmuch-tree-mode-hook
1096 occur-mode-hook
1097 org-agenda-mode-hook
1098 pdf-outline-buffer-mode-hook
1099 proced-mode-hook
1100 tabulated-list-mode-hook))
1101 (lin-global-mode))
1102
1103(use-package gcmh
1104 :ensure t
1105 :config
1106 (setopt gcmh-idle-delay 'auto
1107 gcmh-verbose nil)
1108 (gcmh-mode))
1109
1110(use-package tmr
1111 :ensure t
1112 :preface
1113 (defun tmr-mode-line ()
1114 (if (seq-find (lambda (tmr)
1115 (not (tmr--timer-finishedp tmr)))
1116 tmr--timers)
1117 (propertize "⏲" 'face 'font-lock-warning-face)
1118 ""))
1119 (add-to-list 'global-mode-string
1120 '("" (:eval (tmr-mode-line)))
1121 'append))
1122
1123;; (use-package elfeed
1124;; :ensure t
1125;; :preface
1126;; ;; https://karthinks.com/software/lazy-elfeed/
1127;; (defun elfeed-scroll-up-command (&optional arg)
1128;; "Scroll up or go to next feed item in Elfeed"
1129;; (interactive "^P")
1130;; (let ((scroll-error-top-bottom nil))
1131;; (condition-case-unless-debug nil
1132;; (scroll-up-command arg)
1133;; (error (elfeed-show-next)))))
1134;; (defun elfeed-scroll-down-command (&optional arg)
1135;; "Scroll up or go to next feed item in Elfeed"
1136;; (interactive "^P")
1137;; (let ((scroll-error-top-bottom nil))
1138;; (condition-case-unless-debug nil
1139;; (scroll-down-command arg)
1140;; (error (elfeed-show-prev)))))
1141;; :bind (("C-c f" . elfeed))
1142;; :config
1143;; (setopt elfeed-enclosure-default-dir "~/var/download/"
1144;; elfeed-db-directory (sync/ "emacs/elfeed/db" t)
1145;; elfeed-curl-max-connections 4)
1146;; (add-hook 'elfeed-search-update-hook #'truncate-lines-local-mode)
1147;; (keymap-set elfeed-show-mode-map "SPC" #'elfeed-scroll-up-command)
1148;; (keymap-set elfeed-show-mode-map "S-SPC" #'elfeed-scroll-down-command)
1149;; (keymap-set elfeed-search-mode-map "a" #'elfeed-search-untag-all-unread)
1150;; (setq elfeed-feeds nil) ; Always reload the feed list from feeds.opml
1151;; (elfeed-load-opml "~/var/feeds.opml"))
1152
1153(use-package iedit ; XXX: is this necessary?
1154 :ensure t
1155 :init
1156 (customize-set-variable 'iedit-toggle-key-default (kbd "C-'")))
1157
1158(use-package dumb-jump
1159 :ensure t
1160 :hook ((xref-backend-functions . dumb-jump-xref-activate)))
1161
1162(use-package le-thesaurus
1163 :ensure t
1164 :bind (("C-c w s" . le-thesaurus-get-synonyms)
1165 ("C-c w a" . le-thesaurus-get-antonyms)))
1166
1167(use-package devdocs
1168 :ensure t
1169 ;; not sure what to bind anything to yet ... so M-x it is
1170 )
1171
1172(use-package comment-dwim-2
1173 :ensure t
1174 :bind (("M-;" . comment-dwim-2)
1175 :map org-mode-map
1176 ("M-;" . org-comment-dwim-2)))