Disable corfu-auto in eshell, shell, and gud

This commit is contained in:
Evie Litherland-Smith 2024-02-01 13:26:29 +00:00
parent 2e97f41105
commit 2243ad8816

View file

@ -977,27 +977,10 @@ Set treesit to fontify all elements, default was 3 (out of 4)
(corfu-mode +1))) (corfu-mode +1)))
(add-hook 'minibuffer-setup-hook #'corfu-enable-always-in-minibuffer 1) (add-hook 'minibuffer-setup-hook #'corfu-enable-always-in-minibuffer 1)
(add-hook 'eshell-mode-hook (defun my/local-corfu-no-auto () (setq-local corfu-auto nil))
(lambda () (with-eval-after-load 'eshell (add-hook 'eshell-mode-hook 'my/local-corfu-no-auto))
(setq-local corfu-auto nil (with-eval-after-load 'shell (add-hook 'shell-mode-hook 'my/local-corfu-no-auto))
corfu-auto-commands nil) (with-eval-after-load 'gud (add-hook 'gud-mode-hook 'my/local-corfu-no-auto)))
(corfu-mode)))
(add-hook 'gud-mode-hook
(lambda ()
(setq-local corfu-auto nil
corfu-auto-commands nil)
(corfu-mode)))
(defun corfu-send-shell (&rest _)
"Send completion candidate when inside comint/eshell."
(cond
((and (derived-mode-p 'eshell-mode) (fboundp 'eshell-send-input))
(eshell-send-input))
((and (derived-mode-p 'comint-mode) (fboundp 'comint-send-input))
(comint-send-input))))
(advice-add #'corfu-insert :after #'corfu-send-shell))
(use-package cape (use-package cape
:ensure t :ensure t