insall codecompanion

This commit is contained in:
♥ Minnie ♥ 2024-12-22 16:29:06 +08:00
parent fdbc21f043
commit 2f48251e91
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
2 changed files with 62 additions and 0 deletions

View file

@ -33,6 +33,7 @@
./plugins/git/lazygit.nix
# Utils
./plugins/utils/codecompanion.nix
./plugins/utils/markdown-preview.nix
./plugins/utils/telescope.nix
./plugins/utils/whichkey.nix

View file

@ -0,0 +1,61 @@
{...}: {
plugins.codecompanion = {
enable = true;
settings = {
adapters = {
ollama = {
__raw = ''
function()
return require('codecompanion.adapters').extend('ollama', {
env = {
url = "http://127.0.0.1:11434",
},
schema = {
model = {
default = 'deepseek-coder-v2:latest',
},
num_ctx = {
default = 4096,
},
num_predict = {
default = -1,
},
},
})
end
'';
};
};
opts = {
log_level = "TRACE";
send_code = true;
use_default_actions = true;
use_default_prompts = true;
};
strategies = {
agent = {
adapter = "ollama";
};
chat = {
adapter = "ollama";
};
inline = {
adapter = "ollama";
};
};
};
};
keymaps = [
{
mode = ["n" "v"];
key = "<leader>tc";
action = "<cmd>CodeCompanionChat Toggle<cr>";
options = {
silent = true;
desc = "Toggle CodeCompanion";
};
}
];
}