feat(corfu): add snippets

Yasnippet is now properly integrated! A previosly-unset default has now
been given to `corfu-on-exact-match`. With snippets, it causes immediate
expansion upon single match by default, so we set it to nil and
recommend against changing it in the README.
This commit is contained in:
Luigi Sartor Piucco 2023-07-26 19:57:21 -03:00
parent c6b7eb6e7c
commit a866bf82f6
No known key found for this signature in database
GPG key ID: 6FF1A01853A47A66
3 changed files with 12 additions and 1 deletions

View file

@ -83,6 +83,14 @@
(add-to-list 'completion-at-point-functions #'cape-elisp-block)))
(advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible))
(use-package! yasnippet-capf
:when (modulep! :editor snippets)
:defer t
:init
(add-hook! 'yas-minor-mode-hook
(defun +corfu-add-yasnippet-capf-h ()
(add-hook 'completion-at-point-functions #'yasnippet-capf 30 t))))
(use-package! corfu-terminal
:when (not (display-graphic-p))
:hook ((corfu-mode . corfu-terminal-mode)))