mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-09 03:56:05 +01:00
Merge fefe9c922e into d4b798a469
This commit is contained in:
commit
df554d1dba
1 changed files with 26 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
lib.nixvim.plugins.mkVimPlugin {
|
||||
|
|
@ -9,6 +11,30 @@ lib.nixvim.plugins.mkVimPlugin {
|
|||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
extraConfig = {
|
||||
warnings = lib.nixvim.mkWarnings "plugins.friendly-snippets" (
|
||||
let
|
||||
snippetConsumers = map (lib.splitString ".") [
|
||||
"plugins.luasnip.enable"
|
||||
"plugins.cmp.enable"
|
||||
"plugins.blink-cmp.enable"
|
||||
"plugins.nvim-snippets.enable"
|
||||
];
|
||||
enabledConsumers = builtins.filter (path: lib.getAttrFromPath path config) snippetConsumers;
|
||||
enabledConsumersPretty = lib.concatMapStringsSep ", " (
|
||||
path: lib.getAttrFromPath path options
|
||||
) enabledConsumers;
|
||||
in
|
||||
{
|
||||
when =
|
||||
config.performance.combinePlugins.enable
|
||||
&& !(builtins.elem "friendly-snippets" config.performance.combinePlugins.standalonePlugins)
|
||||
&& (enabledConsumers != [ ]);
|
||||
message = ''
|
||||
When using ${options.performance.combinePlugins.enable}, ${options.plugins.friendly-snippets.enable} and ${enabledConsumersPretty}:
|
||||
"friendly-snippets" has to be added to ${options.performance.combinePlugins.standalonePlugins} in order to be picked up by the aforementioned plugins.
|
||||
'';
|
||||
}
|
||||
);
|
||||
# Simply add an element to the `fromVscode` list to trigger the import of friendly-snippets
|
||||
plugins.luasnip.fromVscode = [ { } ];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue