mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-29 20:04:28 +02:00
plugins/completion: move to by-name
- Move nvim-cmp to plugins/cmp - Move other completion plugins to plugins/by-name
This commit is contained in:
parent
3211a63306
commit
ad85cd760e
36 changed files with 2 additions and 9 deletions
77
plugins/by-name/coq-thirdparty/default.nix
vendored
Normal file
77
plugins/by-name/coq-thirdparty/default.nix
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.coq-thirdparty;
|
||||
in
|
||||
{
|
||||
options.plugins.coq-thirdparty = {
|
||||
enable = mkEnableOption "coq-thirdparty";
|
||||
|
||||
package = lib.mkPackageOption pkgs "coq-thirdparty" {
|
||||
default = [
|
||||
"vimPlugins"
|
||||
"coq-thirdparty"
|
||||
];
|
||||
};
|
||||
|
||||
sources = mkOption {
|
||||
type = types.listOf (
|
||||
types.submodule {
|
||||
freeformType = types.attrs;
|
||||
|
||||
options = {
|
||||
src = mkOption {
|
||||
type = types.str;
|
||||
description = "The name of the source";
|
||||
};
|
||||
|
||||
short_name = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
A short name for the source.
|
||||
If not specified, it is uppercase `src`.
|
||||
'';
|
||||
example = "nLUA";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
description = ''
|
||||
List of sources.
|
||||
Each source is a free-form type, so additional settings like `accept_key` may be specified even if they are not declared by nixvim.
|
||||
'';
|
||||
default = [ ];
|
||||
example = [
|
||||
{
|
||||
src = "nvimlua";
|
||||
short_name = "nLUA";
|
||||
}
|
||||
{
|
||||
src = "vimtex";
|
||||
short_name = "vTEX";
|
||||
}
|
||||
{
|
||||
src = "copilot";
|
||||
short_name = "COP";
|
||||
accept_key = "<c-f>";
|
||||
}
|
||||
{ src = "demo"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
extraPlugins = [ cfg.package ];
|
||||
|
||||
extraConfigLua = ''
|
||||
require('coq_3p')(${helpers.toLuaObject cfg.sources})
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue