From 9c54aeed6ffa159027079871ee398b07c9e1209d Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 20 Apr 2023 23:23:50 -0400 Subject: [PATCH] Configure corfu --- emacs/.emacs.d/config/init-ide.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs.d/config/init-ide.el b/emacs/.emacs.d/config/init-ide.el index 58c0ae7..f89961e 100644 --- a/emacs/.emacs.d/config/init-ide.el +++ b/emacs/.emacs.d/config/init-ide.el @@ -5,7 +5,24 @@ ;; Corfu-mode provides inline autocompletion (use-package corfu :init - (global-corfu-mode)) + (global-corfu-mode) + :config + (defun corfu-move-to-minibuffer () + (interactive) + (when completion-in-region--data + (let ((completion-extra-properties corfu--extra) + completion-cycle-threshold completion-cycling) + (apply #'consult-completion-in-region completion-in-region--data)))) + (defun corfu-enable-in-minibuffer () + "Enable Corfu in the minibuffer if `completion-at-point' is bound." + (when (where-is-internal #'completion-at-point (list (current-local-map))) + (setq-local corfu-echo-delay nil ;; Disable automatic echo and popup + corfu-popupinfo-delay nil) + (corfu-mode 1))) + (add-hook 'minibuffer-setup-hook #'corfu-enable-in-minibuffer) + :general + (corfu-map "S-SPC" #'corfu-insert-separator + "M-m" #'corfu-move-to-minibuffer)) ;; Quick file overview for supported modes (use-package imenu