branch: externals/corfu
commit 6572247264f2aef53ac150899adbd62d6c3b56ca
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    Bind [tab] and [return]
---
 README.org | 5 +++--
 corfu.el   | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 3d63f5b..deada7a 100644
--- a/README.org
+++ b/README.org
@@ -58,7 +58,6 @@ However Corfu works well with the default completion styles, 
the use of
 Orderless is not a necessity. Here is an example configuration:
 
 #+begin_src emacs-lisp
-  ;; Configure corfu
   (use-package corfu
     ;; Optional customizations
     ;; :custom
@@ -70,7 +69,9 @@ Orderless is not a necessity. Here is an example 
configuration:
     ;; Optionally use TAB for cycling, default is `corfu-complete'.
     ;; :bind (:map corfu-map
     ;;        ("TAB" . corfu-next)
-    ;;        ("S-TAB" . corfu-previous))
+    ;;        ([tab] . corfu-next)
+    ;;        ("S-TAB" . corfu-previous)
+    ;;        ([backtab] . corfu-previous))
 
     ;; You may want to enable Corfu only for certain modes.
     ;; :hook ((prog-mode . corfu-mode)
diff --git a/corfu.el b/corfu.el
index d1ede4a..c8902b6 100644
--- a/corfu.el
+++ b/corfu.el
@@ -131,11 +131,13 @@ filter string with spaces is allowed."
     (define-key map [remap end-of-buffer] #'corfu-last)
     (define-key map [remap scroll-down-command] #'corfu-scroll-down)
     (define-key map [remap scroll-up-command] #'corfu-scroll-up)
-    (define-key map [down] #'corfu-next)
-    (define-key map [up] #'corfu-previous)
     (define-key map [remap next-line] #'corfu-next)
     (define-key map [remap previous-line] #'corfu-previous)
     (define-key map [remap completion-at-point] #'corfu-complete)
+    (define-key map [down] #'corfu-next)
+    (define-key map [up] #'corfu-previous)
+    (define-key map [return] #'corfu-insert)
+    (define-key map [tab] #'corfu-complete)
     (define-key map "\en" #'corfu-next)
     (define-key map "\ep" #'corfu-previous)
     (define-key map "\e\e\e" #'corfu-quit)

Reply via email to