Update
Some checks failed
/ Test config on 20 (push) Failing after 1m4s

This commit is contained in:
Maciej 2026-04-08 14:38:54 +03:00
parent c2e63a1fa6
commit 08cc760f1c
Signed by: maciej
GPG key ID: 28243AF437E32F99
8 changed files with 97 additions and 103 deletions

View file

@ -2,6 +2,17 @@
;;; Commentary:
;;; Completion framework configuration
;;; Code:
(eval-when-compile
(defvar corfu-terminal-mode 'corfu-terminal)
(declare-function cape-dabbrev 'cape)
(declare-function cape-file 'cape)
(declare-function cape-keyword 'cape)
(declare-function cape-elisp-symbol 'cape)
(declare-function cape-capf-super 'cape)
(declare-function yasnippet-capf 'yasnippet)
(declare-function nerd-icons-corfu-formatter 'nerd-icons-corfu)
(declare-function eglot-completion-at-point 'eglot))
(use-package yasnippet :ensure t :defer t
:hook ((elpaca-after-init . yas-global-mode))
:config
@ -19,7 +30,6 @@
;; Go up to go the the last item on the list
(setopt corfu-cycle t
corfu-count 20 ;; Show 20 completion candidates
corfu-max-width 100 ;; Max width of the corfu frame
corfu-right-margin-width 0.5
corfu-left-margin-width 0.5
@ -45,12 +55,6 @@
;; These are actual completions
(use-package cape :ensure t :after corfu
:config
(declare-function cape-dabbrev 'cape)
(declare-function cape-file 'cape)
(declare-function cape-keyword 'cape)
(declare-function cape-elisp-symbol 'cape)
(declare-function cape-capf-super 'cape)
;; Set default completion values:
(set-default 'completion-at-point-functions
(list (cape-capf-super #'cape-dabbrev #'yasnippet-capf)
@ -67,9 +71,10 @@
(defun icejam-set-eglot-capfs ()
"Set `completion-at-point-function` to list where LSP is supported."
(setq-local completion-at-point-functions
(list (cape-capf-super #'yasnippet-capf #'eglot-completion-at-point)
#'cape-dabbrev
#'cape-file)))
(list
(cape-capf-super #'yasnippet-capf #'eglot-completion-at-point)
#'cape-dabbrev
#'cape-file)))
(defun icejam-set-elisp-capfs ()
"Set `completion-at-point-function` to what is useful in Elisp."
@ -82,13 +87,10 @@
(use-package yasnippet-capf :ensure t :after corfu :defer t
:config
(declare-function yasnippet-capf 'yasnippet)
(setopt yasnippet-capf-lookup-by 'name))
(use-package nerd-icons-corfu :ensure t :defer 5
:after corfu
(use-package nerd-icons-corfu :ensure t :after corfu :defer 5
:config
(declare-function nerd-icons-corfu-formatter 'nerd-icons-corfu)
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
(provide 'icejam-complete-at-point)