mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-03 05:44:31 +02:00
plugins/cmp-tabby: init
This commit is contained in:
parent
990a18ba23
commit
01c21406c6
4 changed files with 73 additions and 0 deletions
|
@ -28,6 +28,7 @@ in
|
||||||
"cmp-clippy" = "cmp-clippy";
|
"cmp-clippy" = "cmp-clippy";
|
||||||
"cmp-cmdline-history" = "cmp-cmdline-history";
|
"cmp-cmdline-history" = "cmp-cmdline-history";
|
||||||
"cmp_pandoc" = "cmp-pandoc-nvim";
|
"cmp_pandoc" = "cmp-pandoc-nvim";
|
||||||
|
"cmp_tabby" = "cmp-tabby";
|
||||||
"cmp_tabnine" = "cmp-tabnine";
|
"cmp_tabnine" = "cmp-tabnine";
|
||||||
"codeium" = "codeium-nvim";
|
"codeium" = "codeium-nvim";
|
||||||
"conventionalcommits" = "cmp-conventionalcommits";
|
"conventionalcommits" = "cmp-conventionalcommits";
|
||||||
|
|
44
plugins/completion/nvim-cmp/sources/cmp-tabby.nix
Normal file
44
plugins/completion/nvim-cmp/sources/cmp-tabby.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
helpers,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.plugins.cmp-tabby;
|
||||||
|
in {
|
||||||
|
meta.maintainers = [maintainers.GaetanLepage];
|
||||||
|
|
||||||
|
options.plugins.cmp-tabby =
|
||||||
|
helpers.extraOptionsOptions
|
||||||
|
// {
|
||||||
|
host = helpers.defaultNullOpts.mkStr "http://localhost:5000" ''
|
||||||
|
The adress of the tabby host server.
|
||||||
|
'';
|
||||||
|
|
||||||
|
maxLines = helpers.defaultNullOpts.mkUnsignedInt 100 ''
|
||||||
|
The max number of lines to complete.
|
||||||
|
'';
|
||||||
|
|
||||||
|
runOnEveryKeyStroke = helpers.defaultNullOpts.mkBool true ''
|
||||||
|
Whether to run the completion on every keystroke.
|
||||||
|
'';
|
||||||
|
|
||||||
|
stop = helpers.defaultNullOpts.mkListOf types.str ''["\n"]'' "";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
extraConfigLua = let
|
||||||
|
setupOptions = with cfg;
|
||||||
|
{
|
||||||
|
inherit host;
|
||||||
|
max_lines = maxLines;
|
||||||
|
run_on_every_keystroke = runOnEveryKeyStroke;
|
||||||
|
inherit stop;
|
||||||
|
}
|
||||||
|
// cfg.extraOptions;
|
||||||
|
in ''
|
||||||
|
require('cmp_tabby.config'):setup(${helpers.toLuaObject setupOptions})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -14,6 +14,7 @@ in {
|
||||||
[
|
[
|
||||||
./codeium-nvim.nix
|
./codeium-nvim.nix
|
||||||
./copilot-cmp.nix
|
./copilot-cmp.nix
|
||||||
|
./cmp-tabby.nix
|
||||||
./cmp-tabnine.nix
|
./cmp-tabnine.nix
|
||||||
./crates-nvim.nix
|
./crates-nvim.nix
|
||||||
]
|
]
|
||||||
|
|
27
tests/test-sources/plugins/completion/cmp-tabby.nix
Normal file
27
tests/test-sources/plugins/completion/cmp-tabby.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins.nvim-cmp = {
|
||||||
|
enable = true;
|
||||||
|
sources = [
|
||||||
|
{name = "cmp_tabby";}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
plugins = {
|
||||||
|
nvim-cmp = {
|
||||||
|
enable = true;
|
||||||
|
sources = [
|
||||||
|
{name = "cmp_tabby";}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
cmp-tabby = {
|
||||||
|
host = "http://localhost:5000";
|
||||||
|
maxLines = 100;
|
||||||
|
runOnEveryKeyStroke = true;
|
||||||
|
stop = ["\n"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue