From b8fa1bfbf40f32ac84aa45c53ae349f65d7073d7 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 20 May 2022 23:15:20 +0100 Subject: better term support: corfu --- completion.org | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'completion.org') diff --git a/completion.org b/completion.org index 7285bf5..ad35b9a 100644 --- a/completion.org +++ b/completion.org @@ -166,13 +166,12 @@ ("C-p" . jao-corfu-quit-or-previous))) (defun corfu-in-minibuffer () - "Enable Corfu in the minibuffer only if Mct/Vertico are not active." - (unless (or (bound-and-true-p mct--active) - (bound-and-true-p vertico--input)) + "Enable Corfu in the minibuffer only if vertico is not active." + (when (and window-system (not (bound-and-true-p vertico--input))) (corfu-mode 1))) - ;; (add-hook 'minibuffer-setup-hook #'corfu-in-minibuffer 1) - ;; (global-corfu-mode 1) + (add-hook 'minibuffer-setup-hook #'corfu-in-minibuffer 1) + (global-corfu-mode 1) #+end_src * vertico @@ -186,11 +185,10 @@ org-refile-use-outline-path t) :config - ;; Use `consult-completion-in-region' if Vertico is enabled. - ;; Otherwise use the default `completion--in-region' function. + (setq completion-in-region-function (lambda (&rest args) - (apply (if vertico-mode + (apply (if (and (not window-system) vertico-mode) #'consult-completion-in-region #'completion--in-region) args))) @@ -208,6 +206,7 @@ :bind (:map vertico-map (("RET" . vertico-directory-enter) ("M-" . vertico-directory-delete-word) ("" . vertico-directory-delete-char)))) + (vertico-mode) #+end_src -- cgit v1.2.3