reddit / emacs

Corfu - bind "C-k" to corfu-previous

SaiDuc · 2022-03-15 20:36
Hi, I have switched from Company to Corfu but I am having difficulty getting the binding "C-k" to work as corfu previous. I use evil-mode so this would be a useful binding. My corfu setup is: (use-package corfu :straight t :defer t :diminish :bind (:map corfu-map ("TAB" . corfu-next) ([tab] . corfu-next) ("S-TAB" . corfu-previous) ([backtab] . corfu-previous) ("C-j" . corfu-next) ("C-k" . corfu-previous))) "C-j" works completely fine, but "C-k" executes the action `evil-insert-digraph` (not entirely sure what that does...). Any suggestions are appreciated!
SaiDuc · 2022-03-15 21:40
Update: I have solved this now by setting (use-package evil :straight t :bind (:map evil-insert-state-map ("C-k" . nil))) If there is a better way, please enlighten me!
shitterwithaclitter · 2022-03-16 02:44
I struggled with this for a long time. Check out issue #12 on the corfu github repo. What worked for me was running the following after corfu was loaded: (evil-make-overriding-map corfu-map) (advice-add 'corfu--setup :after 'evil-normalize-keymaps) (advice-add 'corfu--teardown :after 'evil-normalize-keymaps)