summaryrefslogtreecommitdiff
path: root/config.el
diff options
context:
space:
mode:
authorcashmere <cashmere@autistici.org>2026-08-12 20:40:00 +0200
committercashmere <cashmere@autistici.org>2026-08-12 20:40:00 +0200
commitfc3760426e1e4a68e4fad4f6dc8fca7297830041 (patch)
tree585bbae586dedaf81e231a365b3672766266a58c /config.el
parent76b9f528de37b8fb7207cbfe01f584c2f9ea786f (diff)
downloademacs-fc3760426e1e4a68e4fad4f6dc8fca7297830041.tar.gz
md: 2026-08-12T20:40:05+02:00
Diffstat (limited to 'config.el')
-rw-r--r--config.el66
1 files changed, 58 insertions, 8 deletions
diff --git a/config.el b/config.el
index 1a867bc..8dc5735 100644
--- a/config.el
+++ b/config.el
@@ -777,6 +777,34 @@ Temporarily disables notifications during the fetch."
(save-excursion (goto-char (point-max)) (point)))
(set-window-point win (point-max)))))
+(defun my/agent-shell-ret-binding ()
+ (let ((keymap (get-text-property (point) 'keymap)))
+ (when keymap
+ (let ((binding (lookup-key keymap (kbd "RET"))))
+ (when (commandp binding)
+ binding)))))
+
+(defun my/agent-shell-output-at-point-p ()
+ (or (get-text-property (point) 'agent-shell-ui-state)
+ (and (> (point) (point-min))
+ (get-text-property (1- (point)) 'agent-shell-ui-state))))
+
+(defun my/agent-shell-ret ()
+ (interactive)
+ (if-let* ((binding (my/agent-shell-ret-binding)))
+ (call-interactively binding)
+ (cond
+ ((my/agent-shell-output-at-point-p)
+ (agent-shell-ui-toggle-fragment))
+ ((and (derived-mode-p 'agent-shell-mode)
+ (shell-maker-point-at-last-prompt-p))
+ (agent-shell-submit))
+ ((derived-mode-p 'agent-shell-viewport-view-mode)
+ (agent-shell-viewport-next-item))
+ ((derived-mode-p 'agent-shell-mode)
+ (agent-shell-next-item)))))
+
+
(defun my/agent-shell-display-buffer-rules ()
'(("\\*Kimi\\(?:\\*\\|:[^*]*\\*\\)"
(display-buffer-in-side-window)
@@ -800,15 +828,30 @@ Temporarily disables notifications during the fetch."
:config
(advice-add 'shell-maker-submit :after #'my/agent-shell-autoscroll)
(dolist (rule (my/agent-shell-display-buffer-rules))
- (add-to-list 'display-buffer-alist rule))
+ (add-to-list 'display-buffer-alist rule))
(setq agent-shell-tool-use-expand-by-default t)
(setq agent-shell-thought-process-expand-by-default t)
(setq agent-shell-user-message-expand-by-default t)
+ (setq agent-shell-activity-group-expand-by-default t)
(setq agent-shell-diff-delta-command
(when (executable-find "delta")
'("delta" "--no-gitconfig" "--color-only")))
(setq agent-shell-activity-group-header-label-function
- #'agent-shell-activity-group-descriptive-label)
+ #'agent-shell-activity-group-descriptive-label)
+ (define-key agent-shell-mode-map (kbd "RET") #'my/agent-shell-ret)
+ (define-key agent-shell-mode-map (kbd "<return>") #'my/agent-shell-ret)
+ (define-key agent-shell-viewport-view-mode-map (kbd "RET") #'my/agent-shell-ret)
+ (define-key agent-shell-viewport-view-mode-map (kbd "<return>") #'my/agent-shell-ret)
+ (with-eval-after-load 'evil
+ (evil-define-key '(normal motion) agent-shell-mode-map
+ (kbd "RET") #'my/agent-shell-ret
+ (kbd "<return>") #'my/agent-shell-ret)
+ (evil-define-key 'insert agent-shell-mode-map
+ (kbd "RET") #'agent-shell-submit
+ (kbd "<return>") #'agent-shell-submit)
+ (evil-define-key '(normal motion) agent-shell-viewport-view-mode-map
+ (kbd "RET") #'my/agent-shell-ret
+ (kbd "<return>") #'my/agent-shell-ret))
;; Work around agent-shell's `window-system' guard so clipboard images
@@ -2975,11 +3018,6 @@ created later still get them."
-(use-package batppuccin
- :ensure t
- :config
- (load-theme 'batppuccin-mocha t))
-
;; (use-package solarized-theme
;; :ensure t
;; :config
@@ -3045,6 +3083,17 @@ created later still get them."
(with-eval-after-load 'general
(my-leader "oc" '(croc-ui :wk "croc"))))
+(use-package textui
+ :ensure (:host github :repo "yibie/textui" :files ("*.el")))
+
+(use-package yggdrasil-ui
+ :ensure nil
+ :after textui
+ :commands (yggdrasil-ui)
+ :init
+ (with-eval-after-load 'general
+ (my-leader "ov" '(yggdrasil-ui :wk "yggdrasil"))))
+
(use-package sync-ui
:ensure nil
:commands (sync-ui))
@@ -3614,8 +3663,9 @@ workspace (e.g. *scratch*)."
"oa" '(my/app-launcher :wk "app launcher")
"os" '(my/snip-upload :wk "snip buffer/region")
"oS" '(my/snip-upload-file :wk "snip file")
- "op" '(passage :wk "pass")
+ "op" '(pass :wk "pass")
"ot" '(ghostel :wk "ghostel")
+ "oz" '(zfs :wk "zfs")
"h" '(:ignore t :wk "help")
"hm" '(describe-mode :wk "mode")