big changes to neovim, might streamline later, also some term environment settings
This commit is contained in:
59
home/modules/devtools/neovim/plugins/ai.nix
Normal file
59
home/modules/devtools/neovim/plugins/ai.nix
Normal 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"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user