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