completion/blink-cmp: option to enable friendly-snippets

Just adds it to the environment,
`blink-cmp` will pick up on it automatically.
This commit is contained in:
alfarel 2025-02-25 23:17:19 -05:00 committed by raf
parent 9e35fd8d02
commit 449b943b95
3 changed files with 7 additions and 2 deletions
docs/release-notes
modules/plugins/completion/blink-cmp

View file

@ -207,6 +207,9 @@
- Add [direnv.vim](https://github.com/direnv/direnv.vim) plugin - Add [direnv.vim](https://github.com/direnv/direnv.vim) plugin
for automatic syncing of nvim shell environment with direnv's. for automatic syncing of nvim shell environment with direnv's.
- Add [blink.cmp] source options and some default-disabled sources. - Add [blink.cmp] source options and some default-disabled sources.
- Add [blink.cmp] option to add
[friendly-snippets](https://github.com/rafamadriz/friendly-snippets)
so blink.cmp can source snippets from it.
[TheColorman](https://github.com/TheColorman) [TheColorman](https://github.com/TheColorman)

View file

@ -177,5 +177,7 @@ in {
Attribute names must be source names used in {option}`vim.autocomplete.blink-cmp.setupOpts.sources.default`. Attribute names must be source names used in {option}`vim.autocomplete.blink-cmp.setupOpts.sources.default`.
''; '';
}; };
friendly-snippets.enable = mkEnableOption "friendly-snippets for blink to source from automatically";
}; };
} }

View file

@ -7,7 +7,7 @@
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
inherit (lib.generators) mkLuaInline; inherit (lib.generators) mkLuaInline;
inherit (lib.attrsets) attrValues filterAttrs; inherit (lib.attrsets) attrValues filterAttrs;
inherit (lib.lists) map; inherit (lib.lists) map optional;
inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.lua) toLuaObject;
inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs; inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs;
@ -26,7 +26,7 @@
blinkSourcePlugins = map (definition: definition.package) (attrValues enabledBlinkSources); blinkSourcePlugins = map (definition: definition.package) (attrValues enabledBlinkSources);
in { in {
vim = mkIf cfg.enable { vim = mkIf cfg.enable {
startPlugins = ["blink-compat"] ++ blinkSourcePlugins; startPlugins = ["blink-compat"] ++ blinkSourcePlugins ++ (optional cfg.friendly-snippets.enable "friendly-snippets");
lazy.plugins = { lazy.plugins = {
blink-cmp = { blink-cmp = {
package = "blink-cmp"; package = "blink-cmp";