diff options
-rw-r--r-- | completion.org | 15 |
1 files changed, 9 insertions, 6 deletions
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-<return>" . newline) - ("TAB" . corfu-next) - ([tab] . corfu-next) - ("S-TAB" . corfu-previous) - ([backtab] . corfu-previous))) + ("C-<return>" . corfu-insert) + ("\r" . jao-corfu-quit-or-insert))) (corfu-global-mode 1) |