1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-09 02:21:07 +01:00
nixvim/plugins/by-name/llm/default.nix
2025-12-07 23:34:03 +00:00

53 lines
1.2 KiB
Nix

{
lib,
config,
...
}:
lib.nixvim.plugins.mkNeovimPlugin {
name = "llm";
package = "llm-nvim";
description = "llm.nvim is a plugin for all things LLM. It uses `llm-ls` as a backend.";
maintainers = [ lib.maintainers.GaetanLepage ];
dependencies = [ "llm-ls" ];
extraConfig = {
# If not setting this option, llm.nvim will try to download the llm-ls binary from the internet.
plugins.llm.settings.lsp.bin_path =
let
llm-ls-dep = config.dependencies.llm-ls;
in
lib.mkIf llm-ls-dep.enable (lib.mkDefault (lib.getExe llm-ls-dep.package));
};
settingsOptions = import ./settings-options.nix lib;
settingsExample = {
max_tokens = 1024;
url = "https://open.bigmodel.cn/api/paas/v4/chat/completions";
model = "glm-4-flash";
prefix = {
user = {
text = "😃 ";
hl = "Title";
};
assistant = {
text = " ";
hl = "Added";
};
};
save_session = true;
max_history = 15;
keys = {
"Input:Submit" = {
mode = "n";
key = "<cr>";
};
"Input:Cancel" = {
mode = "n";
key = "<C-c>";
};
};
};
}