refactor: removing needless module complexity

This commit is contained in:
cnst
2024-10-27 09:14:34 +01:00
parent d8f810ee05
commit 4887feccfd
175 changed files with 920 additions and 1118 deletions

View File

@@ -0,0 +1,53 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.copilot;
in {
options = {
home.devtools.nixvim.plugins.copilot.enable = mkEnableOption "Enables AI tools for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins = {
copilot-chat = {
enable = true;
};
copilot-lua = {
enable = true;
suggestion = {
enabled = false;
autoTrigger = true;
keymap.accept = "<C-CR>";
};
panel.enabled = false;
};
};
keymaps = [
{
action = "<cmd>lua local input = vim.fn.input('Quick Chat: '); if input ~= '' then require('CopilotChat').ask(input, { selection = require('CopilotChat.select').buffer }) end<CR>";
key = "<leader>qc";
options = {
desc = "CopilotChat - Quick chat";
};
mode = [
"n"
];
}
{
action = "<cmd>CopilotChatToggle<CR>";
key = "<leader>ac";
options = {
desc = "Toggle Coilot chat";
};
mode = [
"n"
];
}
];
};
};
}