mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-22 08:04:20 +01:00
cfcb6735b1
Signed-off-by: magic_rb <magic_rb@redalder.org>
2.4 KiB
2.4 KiB
Corfu
#
Corfu enhances completion at point with a small completion popup. The current candidates are shown in a popup below or above the point. Corfu is the minimalistic completion-in-region counterpart of the Vertico minibuffer UI.
(use-package corfu
:straight t
:custom
(corfu-separator ?\s) ;; M-SPC
:general
("C-c c" 'completion-at-point)
:init
(global-corfu-mode))
Company
Disable company
globally, because company enables itself…
(setq company-global-modes nil)
LSP Mode
Make lsp-mode
not turn on company
first thing after start, so annoying.
(setq lsp-completion-provider :none)
Cape
cape
provides useful capfs
, such as file and ispell completion, stuff that company
has built-in.
Hook cape
onto both text-mode
and prog-mode
.
(defun cape-setup-capf-prog ()
"Setup cape completions for prog-mode"
(cape-setup-capf))
(defun cape-setup-capf-text ()
"Setup cape completions for text-mode"
(cape-setup-capf))
(defun cape-setup-capf ()
"Setup cape completions"
(add-hook 'completion-at-point-functions #'cape-file)
(add-hook 'completion-at-point-functions #'cape-tex))
:hook
((prog-mode . cape-setup-capf-prog)
(text-mode . cape-setup-capf-text))
lsp-mode
completely wipes completion-at-point-functions
, so we need re-add cape
after it removes everything.
(use-package cape-lsp-mode
:no-require t
:after (cape lsp-mode)
:hook
((lsp-mode . #'cape-setup-capf)))