mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 09:48:42 +02:00
Introduce the internal option `cmpSourcePlugins` where plugins can register their nvim-cmp source name association.
28 lines
539 B
Nix
28 lines
539 B
Nix
{
|
|
lib,
|
|
helpers,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with helpers.vim-plugin;
|
|
with lib;
|
|
{
|
|
mkCmpSourcePlugin =
|
|
{
|
|
name,
|
|
sourceName,
|
|
extraPlugins ? [ ],
|
|
useDefaultPackage ? true,
|
|
...
|
|
}:
|
|
mkVimPlugin config {
|
|
inherit name;
|
|
extraPlugins = extraPlugins ++ (lists.optional useDefaultPackage pkgs.vimPlugins.${name});
|
|
|
|
maintainers = [ maintainers.GaetanLepage ];
|
|
|
|
# Register the source -> plugin name association
|
|
imports = [ { cmpSourcePlugins.${sourceName} = name; } ];
|
|
};
|
|
}
|