feat(config): make C-x corfu bindings optional

For someone like me that uses the vanilla emacs commands bound to C-x
C-p, C-x C-n, etc, I prefer to set the completion keybindings manually.
This commit is contained in:
StrawberryTea 2024-02-17 10:52:57 -06:00 committed by Luigi Sartor Piucco
parent 3b275b271a
commit 39b0de8736
2 changed files with 12 additions and 8 deletions

View file

@ -3,6 +3,9 @@
(defvar +corfu-buffer-scanning-size-limit (* 1 1024 1024) ; 1 MB
"Size limit for a buffer to be scanned by `cape-dabbrev'.")
(defvar +corfu-want-C-x-bindings t
"Whether `C-x' is a completion prefix in Evil insert state.")
;;
;;; Packages
(use-package! corfu

View file

@ -163,14 +163,15 @@
(:after corfu
(:map corfu-mode-map
:e "C-M-i" #'completion-at-point
(:prefix "C-x"
:i "C-l" #'cape-line
:i "C-k" #'cape-keyword
:i "C-f" #'cape-file
:i "s" #'cape-dict
:i "C-s" #'yasnippet-capf
:i "C-n" #'cape-dabbrev
:i "C-p" #'cape-history)
(:when +corfu-want-C-x-bindings
(:prefix "C-x"
:i "C-l" #'cape-line
:i "C-k" #'cape-keyword
:i "C-f" #'cape-file
:i "s" #'cape-dict
:i "C-s" #'yasnippet-capf
:i "C-n" #'cape-dabbrev
:i "C-p" #'cape-history))
(:unless (modulep! :completion corfu +tng)
:i "C-SPC" #'completion-at-point
:n "C-SPC" (cmd! (call-interactively #'evil-insert-state)