From 32e12c8344a5b05d7b52f3bbe2c32cea3a3a1d5d Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 3 Dec 2021 02:10:05 +0000 Subject: corfu, approaching perfection (via consistency with mct) --- completion.org | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'completion.org') diff --git a/completion.org b/completion.org index c0b0a88..b9c273d 100644 --- a/completion.org +++ b/completion.org @@ -60,7 +60,7 @@ corfu-cycle t corfu-count 15 corfu-quit-no-match t - corfu-auto nil + corfu-auto t corfu-commit-predicate nil corfu-preview-current nil corfu-preselect-first nil @@ -86,12 +86,15 @@ (jao-corfu-no-auto eshell) (add-to-list 'corfu-excluded-modes 'notmuch-message-mode) + (defun jao-corfu-quit-or-insert () + (interactive) + (if (and (>= corfu--index 0) (/= corfu--index corfu--preselect)) + (corfu-insert) + (corfu-quit))) + :bind (:map corfu-map - ("C-" . newline) - ("TAB" . corfu-next) - ([tab] . corfu-next) - ("S-TAB" . corfu-previous) - ([backtab] . corfu-previous))) + ("C-" . corfu-insert) + ("\r" . jao-corfu-quit-or-insert))) (corfu-global-mode 1) -- cgit v1.2.3