big changes to neovim, might streamline later, also some term environment settings

This commit is contained in:
cnst
2024-08-19 21:24:21 +02:00
parent 5f2487c4ab
commit dffdbb1581
52 changed files with 1471 additions and 447 deletions

View File

@@ -0,0 +1,59 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.ai;
in
{
options = {
modules.devtools.neovim.plugins.ai.enable = mkEnableOption "Enables AI tools for Neovim";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins = {
chatgpt = {
enable = true;
settings = {
api_key_cmd = "cat ${config.sops.secrets.openai_api_key.path}";
};
};
copilot-chat.enable = true;
copilot-lua = {
enable = true;
suggestion = {
enabled = true;
autoTrigger = true;
keymap.accept = "<C-CR>";
};
panel.enabled = false;
};
};
keymaps = [
{
action = "<cmd>CopilotChatToggle<CR>";
key = "<leader>ac";
options = {
desc = "Toggle Coilot chat";
};
mode = [
"n"
];
}
{
action = "<cmd>ChatGPT<CR>";
key = "<leader>ag";
options = {
desc = "Toggle ChatGPT";
};
mode = [
"n"
];
}
];
};
};
}