Tweak corfu and cape configs

This commit is contained in:
Evie Litherland-Smith 2024-01-08 21:15:35 +00:00
parent b737cf0d14
commit 0569db25d6

View file

@ -875,18 +875,27 @@ Set treesit to fontify all elements, default was 3 (out of 4)
#+begin_src emacs-lisp
(use-package corfu
:ensure t
:after (vertico orderless)
:demand
:custom
(corfu-cycle t)
(corfu-auto t)
(corfu-auto-prefix 3)
(corfu-quit-no-match 'separator)
(corfu-quit-at-boundary 'separator)
(corfu-preview-current 'insert)
(corfu-preselect 'directory)
:bind ( :map corfu-map
("M-SPC" . corfu-insert-separator)
("RET" . nil)
("TAB" . corfu-next)
([tab] . corfu-next)
("S-TAB" . corfu-previous)
([backtab] . corfu-previous)
("S-<return>". corfu-insert))
:init
(global-corfu-mode +1)
(corfu-history-mode +1)
:config
(keymap-set corfu-map "RET" nil)
(when (require 'corfu-popupinfo nil :noerror)
(corfu-popupinfo-mode +1)
(keymap-set corfu-map "M-p" #'corfu-popupinfo-scroll-down)
@ -905,7 +914,9 @@ Set treesit to fontify all elements, default was 3 (out of 4)
(add-hook 'eshell-mode-hook
(lambda ()
(setq-local corfu-auto nil)
(setq-local corfu-auto nil
corfu-quit-at-boundary t
corfu-quit-no-match t)
(corfu-mode)))
(defun corfu-send-shell (&rest _)
@ -920,10 +931,9 @@ Set treesit to fontify all elements, default was 3 (out of 4)
(use-package cape
:ensure t
:after (corfu)
:demand
:init
(add-to-list 'completion-at-point-functions #'cape-emoji)
(add-to-list 'completion-at-point-functions #'cape-dict)
(add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-dabbrev))
#+end_src