mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 08:53:28 +02:00
plugins/cmp: refactor sources list & mkCmpSourcePlugin
List mkCmpSourcePlugin args directly in `sources/default.nix`, similar to LSP's language-servers list.
This commit is contained in:
parent
3a8d4fee35
commit
17f4aa5556
5 changed files with 218 additions and 93 deletions
30
plugins/completion/cmp/sources/_mk-cmp-plugin.nix
Normal file
30
plugins/completion/cmp/sources/_mk-cmp-plugin.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
pluginName,
|
||||
sourceName,
|
||||
defaultPackage ? pkgs.vimPlugins.${pluginName},
|
||||
maintainers ? [ lib.maintainers.GaetanLepage ],
|
||||
imports ? [ ],
|
||||
...
|
||||
}@args:
|
||||
helpers.vim-plugin.mkVimPlugin config (
|
||||
builtins.removeAttrs args [
|
||||
"pluginName"
|
||||
"sourceName"
|
||||
]
|
||||
// {
|
||||
inherit defaultPackage maintainers;
|
||||
name = pluginName;
|
||||
|
||||
imports = imports ++ [
|
||||
# Register the source -> plugin name association
|
||||
{ cmpSourcePlugins.${sourceName} = pluginName; }
|
||||
];
|
||||
}
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue