mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-25 09:36:14 +01:00
3638492702
Signed-off-by: main <magic_rb@redalder.org>
2.3 KiB
2.3 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
(corfu-global-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"
(add-hook 'completion-at-point-functions #'cape-ispell)
(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))
(add-hook 'prog-mode-hook 'cape-setup-capf-prog)
(add-hook 'text-mode-hook 'cape-setup-capf-text)
lsp-mode
completely wipes completion-at-point-functions
, so we need re-add cape
after it removes everything.
(use-package lsp-mode
:defer t
:after cape
:config
(add-hook 'lsp-mode-hook 'cape-setup-capf))