about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el76
1 files changed, 67 insertions, 9 deletions
diff --git a/init.el b/init.el index 0ffe042..20010d1 100644 --- a/init.el +++ b/init.el
@@ -536,15 +536,20 @@ like a dumbass."
536 ("web" (or (mode . elpher-mode) 536 ("web" (or (mode . elpher-mode)
537 (mode . gemini-mode) 537 (mode . gemini-mode)
538 (mode . eww-mode)))))) 538 (mode . eww-mode))))))
539 (:global "C-x C-b" ibuffer)
540 539
541 (add-hook 'ibuffer-mode 540 (global-set-key (kbd "C-x C-b")
542 (defun ibuffer@filter-to-default () 541 (defun list-buffers-or-ibuffer (arg)
543 (ibuffer-switch-to-saved-filter-groups "default"))) 542 "`list-buffers', or with a prefix arg, `ibuffer'."
543 (interactive "P")
544 (if arg (ibuffer) (electric-buffer-list nil)))))
544 545
545 (:also-load ibuf-ext) 546(add-hook 'ibuffer-mode
546 (:option ibuffer-show-empty-filter-groups nil 547 (defun ibuffer@filter-to-default ()
547 ibuffer-expert t)) 548 (ibuffer-switch-to-saved-filter-groups "default")))
549
550(:also-load ibuf-ext)
551(:option ibuffer-show-empty-filter-groups nil
552 ibuffer-expert t))
548 553
549(setup imenu 554(setup imenu
550 (:option imenu-auto-rescan t)) 555 (:option imenu-auto-rescan t))
@@ -938,6 +943,41 @@ like a dumbass."
938 (:bind "M-e" consult-isearch 943 (:bind "M-e" consult-isearch
939 "M-s e" consult-isearch 944 "M-s e" consult-isearch
940 "M-s l" consult-line)) 945 "M-s l" consult-line))
946
947 ;; see https://github.com/oantolin/completing-history
948 (defmacro consult-history-to-modes (map-hook-alist)
949 (let (defuns)
950 (dolist (map-hook map-hook-alist)
951 (let ((map-name (symbol-name (car map-hook)))
952 (key-defs `(progn (define-key
953 ,(car map-hook)
954 (kbd "M-r")
955 (function consult-history))
956 (define-key ,(car map-hook)
957 (kbd "M-s") nil))))
958 (push (if (cdr map-hook)
959 `(add-hook ',(cdr map-hook)
960 (defun
961 ,(intern (concat map-name
962 "@consult-history-bind"))
963 nil
964 ,(concat
965 "Bind `consult-history' to M-r in "
966 map-name ".\n"
967 "Defined by `consult-history-to-modes'.")
968 ,key-defs))
969 key-defs)
970 defuns)))
971 `(progn ,@ (nreverse defuns))))
972
973 (consult-history-to-modes ((minibuffer-local-map . nil)
974 (shell-mode-map . shell-mode-hook)
975 (term-mode-map . term-mode-hook)
976 (term-raw-map . term-mode-hook)
977 (comint-mode-map . comint-mode-hook)
978 (sly-mrepl-mode-map . sly-mrepl-hook)))
979
980
941 981
942 ;; Registers 982 ;; Registers
943 (autoload 'consult-register-preview "consult") 983 (autoload 'consult-register-preview "consult")
@@ -1131,6 +1171,10 @@ successive invocations."
1131(setup (:straight form-feed) 1171(setup (:straight form-feed)
1132 (global-form-feed-mode +1)) 1172 (global-form-feed-mode +1))
1133 1173
1174(setup (:straight gcmh)
1175 (:option gcmh-idle-delay 'auto)
1176 (gcmh-mode +1))
1177
1134(setup (:straight geiser)) 1178(setup (:straight geiser))
1135 1179
1136(setup (:straight (gemini-mode 1180(setup (:straight (gemini-mode
@@ -1161,7 +1205,12 @@ successive invocations."
1161 "<help> k" helpful-key 1205 "<help> k" helpful-key
1162 "<help> o" helpful-symbol 1206 "<help> o" helpful-symbol
1163 "C-c C-d" helpful-at-point) 1207 "C-c C-d" helpful-at-point)
1164 (:bind "q" kill-buffer-and-window)) 1208 (define-key helpful-mode-map "q"
1209 (defun helpful-mode|quit ()
1210 (interactive)
1211 (bury-buffer)
1212 (unless (window-parameter (frame-selected-window) 'no-other-window)
1213 (delete-window)))))
1165 1214
1166(setup (:straight iscroll) 1215(setup (:straight iscroll)
1167 (:hook-into text-mode)) 1216 (:hook-into text-mode))
@@ -1500,7 +1549,16 @@ successive invocations."
1500 (:option resize-mini-windows 'grow-only 1549 (:option resize-mini-windows 'grow-only
1501 vertico-count-format nil 1550 vertico-count-format nil
1502 vertico-cycle t) 1551 vertico-cycle t)
1503 1552
1553 (defun up-directory (arg)
1554 "Move up a directory (delete backwards to /)."
1555 (interactive "p")
1556 (if (string-match-p "/." (minibuffer-contents))
1557 (zap-up-to-char (- arg) ?/)
1558 (backward-kill-word arg)))
1559
1560 (define-key vertico-map (kbd "<C-backspace>") #'up-directory)
1561
1504 (if (boundp 'comp-deferred-compilation-deny-list) 1562 (if (boundp 'comp-deferred-compilation-deny-list)
1505 (add-to-list 'comp-deferred-compilation-deny-list "vertico")) 1563 (add-to-list 'comp-deferred-compilation-deny-list "vertico"))
1506 1564