feat(evil): vim completion keybinds on C-x
Vim has a set of completion commands bound to the C-x prefix. We had this for company, but with this commit, we now have them for the corfu module.
This commit is contained in:
parent
8ab42fa774
commit
ce84690dc5
2 changed files with 32 additions and 12 deletions
|
@ -37,3 +37,13 @@
|
||||||
(save-excursion (backward-char 1)
|
(save-excursion (backward-char 1)
|
||||||
(insert-char ?\\)))
|
(insert-char ?\\)))
|
||||||
(t (call-interactively #'corfu-insert-separator))))
|
(t (call-interactively #'corfu-insert-separator))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +corfu/dabbrev-this-buffer ()
|
||||||
|
"Like `cape-dabbrev', but only scans current buffer."
|
||||||
|
(interactive)
|
||||||
|
(require 'cape)
|
||||||
|
(let ((cape-dabbrev-check-other-buffers nil))
|
||||||
|
(cape-dabbrev t)))
|
||||||
|
|
||||||
|
;;; end of autoload.el
|
||||||
|
|
|
@ -576,15 +576,25 @@ directives. By default, this only recognizes C directives.")
|
||||||
:v "gl" #'evil-lion-left
|
:v "gl" #'evil-lion-left
|
||||||
:v "gL" #'evil-lion-right
|
:v "gL" #'evil-lion-right
|
||||||
|
|
||||||
;; Omni-completion
|
;; Emulation of Vim's omni-completion keybinds
|
||||||
(:when (modulep! :completion company)
|
(:prefix "C-x"
|
||||||
(:prefix "C-x"
|
(:when (modulep! :completion company)
|
||||||
:i "C-l" #'+company/whole-lines
|
:i "C-l" #'+company/whole-lines
|
||||||
:i "C-k" #'+company/dict-or-keywords
|
:i "C-k" #'+company/dict-or-keywords
|
||||||
:i "C-f" #'company-files
|
:i "C-f" #'company-files
|
||||||
:i "C-]" #'company-etags
|
:i "C-]" #'company-etags
|
||||||
:i "s" #'company-ispell
|
:i "s" #'company-ispell
|
||||||
:i "C-s" #'company-yasnippet
|
:i "C-s" #'company-yasnippet
|
||||||
:i "C-o" #'company-capf
|
:i "C-o" #'company-capf
|
||||||
:i "C-n" #'+company/dabbrev
|
:i "C-n" #'+company/dabbrev
|
||||||
:i "C-p" #'+company/dabbrev-code-previous)))
|
:i "C-p" #'+company/dabbrev-code-previous)
|
||||||
|
(:when (modulep! :completion corfu)
|
||||||
|
:i "C-l" #'cape-line
|
||||||
|
:i "C-k" #'cape-keyword
|
||||||
|
:i "C-f" #'cape-file
|
||||||
|
:i "C-]" #'complete-tag
|
||||||
|
:i "s" #'cape-dict
|
||||||
|
:i "C-s" #'yasnippet-capf
|
||||||
|
:i "C-o" #'completion-at-point
|
||||||
|
:i "C-n" #'cape-dabbrev
|
||||||
|
:i "C-p" #'+corfu/dabbrev-this-buffer)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue