feat(corfu): vim-like C-n/C-p keybinds

In vim/evil, C-n/C-p invokes dabbrev, so we're doing the same, but
powered by cape-dabbrev, falling back to corfu-next/corfu-prev is a
corfu popup is already open.

Close: #7748
Co-authored-by: 45mg <45mg@users.noreply.github.com>
Co-authored-by: LemonBreezes <LemonBreezes@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2024-08-28 22:43:05 -04:00
parent 4a4a9a1ada
commit 08f8f57e2f
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 30 additions and 0 deletions

View file

@ -192,6 +192,8 @@
(:after corfu
(:map corfu-mode-map
:i "C-SPC" #'completion-at-point
:i "C-n" #'+corfu/dabbrev-or-next
:i "C-p" #'+corfu/dabbrev-or-last
:n "C-SPC" (cmd! (call-interactively #'evil-insert-state)
(call-interactively #'completion-at-point))
:v "C-SPC" (cmd! (call-interactively #'evil-change)