mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-05 14:54:33 +02:00
plugins/coq-thirdparty: init + tests (#282)
This commit is contained in:
parent
db5061b4db
commit
2550c919a5
3 changed files with 95 additions and 0 deletions
65
plugins/completion/coq-thirdparty.nix
Normal file
65
plugins/completion/coq-thirdparty.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.coq-thirdparty;
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in {
|
||||
options.plugins.coq-thirdparty = {
|
||||
enable = mkEnableOption "coq-thirdparty";
|
||||
|
||||
package = helpers.mkPackageOption "coq-thirdparty" pkgs.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";
|
||||
default = [];
|
||||
example = [
|
||||
{
|
||||
src = "nvimlua";
|
||||
shortName = "nLUA";
|
||||
}
|
||||
{
|
||||
src = "vimtex";
|
||||
shortName = "vTEX";
|
||||
}
|
||||
{
|
||||
src = "copilot";
|
||||
shortName = "COP";
|
||||
acceptKey = "<c-f>";
|
||||
}
|
||||
{src = "demo";}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
extraConfigLua = ''
|
||||
require('coq_3p')(${helpers.toLuaObject cfg.sources})
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -11,6 +11,7 @@
|
|||
./colorschemes/tokyonight.nix
|
||||
|
||||
./completion/coq.nix
|
||||
./completion/coq-thirdparty.nix
|
||||
./completion/copilot.nix
|
||||
./completion/nvim-cmp
|
||||
./completion/nvim-cmp/sources
|
||||
|
|
29
tests/test-sources/plugins/completion/coq-thirdparty.nix
Normal file
29
tests/test-sources/plugins/completion/coq-thirdparty.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
# Empty configuration
|
||||
empty = {
|
||||
plugins.coq-thirdparty.enable = true;
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins.coq-thirdparty = {
|
||||
enable = true;
|
||||
|
||||
sources = [
|
||||
{
|
||||
src = "nvimlua";
|
||||
short_name = "nLUA";
|
||||
}
|
||||
{
|
||||
src = "vimtex";
|
||||
short_name = "vTEX";
|
||||
}
|
||||
{
|
||||
src = "copilot";
|
||||
short_name = "COP";
|
||||
accept_key = "<c-f>";
|
||||
}
|
||||
{src = "demo";}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue