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:
parent
85f4c58a3c
commit
787d040ba6
3 changed files with 10 additions and 1 deletions
|
@ -33,6 +33,7 @@ highly non-native, but has some extra features and more maturity.
|
||||||
- [[doom-package:nerd-icons-completion]] if [[doom-module::completion corfu +icons]]
|
- [[doom-package:nerd-icons-completion]] if [[doom-module::completion corfu +icons]]
|
||||||
- [[doom-package:orderless]] if [[doom-module::completion corfu +orderless]]
|
- [[doom-package:orderless]] if [[doom-module::completion corfu +orderless]]
|
||||||
- [[doom-package:corfu-terminal]] if [[doom-module::os tty]]
|
- [[doom-package:corfu-terminal]] if [[doom-module::os tty]]
|
||||||
|
- [[doom-package:yasnippet-capf]] if [[doom-module::editor snippets]]
|
||||||
|
|
||||||
** Hacks
|
** Hacks
|
||||||
/No hacks documented for this module./
|
/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
|
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
|
for completions in languages that have no development intelligence, since it
|
||||||
supports generic, context insensitive candidates such as file names or recurring
|
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
|
* TODO Usage
|
||||||
#+begin_quote
|
#+begin_quote
|
||||||
|
|
|
@ -163,6 +163,12 @@ Meant as :around advice for `corfu--recompute'."
|
||||||
(add-hook! (org-mode markdown-mode) (+corfu--add-capf! #'cape-elisp-block))
|
(add-hook! (org-mode markdown-mode) (+corfu--add-capf! #'cape-elisp-block))
|
||||||
(advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible))
|
(advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible))
|
||||||
|
|
||||||
|
(use-package! yasnippet-capf
|
||||||
|
:after corfu
|
||||||
|
:config
|
||||||
|
(add-hook 'yas-minor-mode-hook
|
||||||
|
(lambda () (add-to-list 'completion-at-point-functions #'yasnippet-capf))))
|
||||||
|
|
||||||
(use-package! corfu-terminal
|
(use-package! corfu-terminal
|
||||||
:when (not (display-graphic-p))
|
:when (not (display-graphic-p))
|
||||||
:hook (corfu-mode . corfu-terminal-mode))
|
:hook (corfu-mode . corfu-terminal-mode))
|
||||||
|
|
|
@ -9,3 +9,5 @@
|
||||||
(package! orderless :pin "d6b402a89e234d0e6166247ed6025f9acc8b4d9a"))
|
(package! orderless :pin "d6b402a89e234d0e6166247ed6025f9acc8b4d9a"))
|
||||||
(when (modulep! :os tty)
|
(when (modulep! :os tty)
|
||||||
(package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc"))
|
(package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc"))
|
||||||
|
(when (modulep! :editor snippets)
|
||||||
|
(package! yasnippet-capf :pin "40654214db7a44db3a99321447632b43a10fae57"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue