feat(corfu): impl smart confirm in minibuffer

An issue when using corfu in the minibuffer was the need for pressing
RET twice, since the first only inserts the completion. This commit
aliviates that by providing C-RET to ignore completion and conclude the
minibuffer immediatelly and S-RET to insert completion then conclude.
This commit is contained in:
Luigi Sartor Piucco 2023-12-21 12:07:39 -03:00
parent a942d2ccae
commit 1983c4c5d9
No known key found for this signature in database
GPG key ID: 6FF1A01853A47A66
3 changed files with 37 additions and 2 deletions

View file

@ -1,5 +1,13 @@
;;; completion/corfu/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +corfu-complete-and-exit-minibuffer ()
(interactive)
(if (>= corfu--index 0)
(corfu-complete)
(corfu-insert))
(exit-minibuffer))
;;;###autoload
(defun +corfu-move-to-minibuffer ()
;; Taken from corfu's README.