mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-08 15:23:35 -05:00
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:
@@ -33,6 +33,7 @@ utilities for fine-tuning. Only some of common behaviors are documented here.
|
||||
- [[doom-package:nerd-icons-corfu]] if [[doom-module::completion corfu +icons]]
|
||||
- [[doom-package:orderless]] if [[doom-module::completion corfu +orderless]]
|
||||
- [[doom-package:corfu-terminal]] if [[doom-module::os tty]]
|
||||
- [[doom-package:yasnippet-capf]] if [[doom-module::editor snippets]]
|
||||
|
||||
** Hacks
|
||||
/No hacks documented for this module./
|
||||
@@ -50,7 +51,7 @@ languages may lack code completion support altogether). Run ~$ doom doctor~ to
|
||||
find out if you're missing any dependencies. Note that Corfu may have support
|
||||
for completions in languages that have no development intelligence, since it
|
||||
supports generic, context insensitive candidates such as file names or recurring
|
||||
words.
|
||||
words. Snippets may also appear in the candidate list if available.
|
||||
|
||||
* TODO Usage
|
||||
#+begin_quote
|
||||
|
@@ -67,6 +67,14 @@ Possible values are:
|
||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent)
|
||||
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify)))
|
||||
|
||||
(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)))
|
||||
|
@@ -9,3 +9,5 @@
|
||||
(package! orderless :pin "b24748093b00b37c3a572c4909f61c08fa27504f"))
|
||||
(when (modulep! :os tty)
|
||||
(package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc"))
|
||||
(when (modulep! :editor snippets)
|
||||
(package! yasnippet-capf :pin "9043f8275176a8f198ce8e81fadab1870fa165bb"))
|
||||
|
Reference in New Issue
Block a user