feat: update ollama settings and add general, display, and strategies options for CodeCompanion

- Added configuration for the ollama adapter in the settings.
- Configured general options including log level, send code, default actions, and prompts.
- Defined display options with action palette prompt, provider, and opts.
- Updated strategies to use the ollama adapter.
- Modified keymaps to include a toggle chat command without specifying an action for now.
This commit is contained in:
♥ Minnie ♥ 2025-02-17 22:15:49 +08:00
parent 875cd4cefa
commit a42a45bdc1
Signed by: jasmine
GPG key ID: 8563E358D4E8040E

View file

@ -2,7 +2,9 @@
plugins.codecompanion = {
enable = true;
# Settings configuration
settings = {
# Adapter settings for ollama
adapters = {
ollama = {
__raw = ''
@ -12,49 +14,64 @@
url = "http://127.0.0.1:11434",
},
schema = {
model = {
default = 'deepseek-coder-v2:latest',
},
num_ctx = {
default = 4096,
},
num_predict = {
default = -1,
},
model = { default = 'deepseek-coder-v2:latest' },
num_ctx = { default = 4096, },
num_predict = { default = -1, },
},
})
end
'';
};
};
# General options for CodeCompanion
opts = {
log_level = "TRACE";
send_code = true;
use_default_actions = true;
use_default_prompts = true;
};
# Display options
display = {
action_palette = {
prompt = "Prompt ";
provider = "telescope";
opts = {
show_default_actions = true;
show_default_prompt_library = true;
};
};
};
# strategies configuration
strategies = {
agent = {
adapter = "ollama";
};
chat = {
adapter = "ollama";
};
inline = {
adapter = "ollama";
};
agent = {adapter = "ollama";};
chat = {adapter = "ollama";};
inline = {adapter = "ollama";};
};
};
};
# Keymaps for CodeCompanion
keymaps = [
{
mode = ["n" "v"];
key = "<leader>tc";
action = "<cmd>CodeCompanionChat Toggle<cr>";
action = "<cmd>CodeCompanionChat<cr>";
options = {
silent = true;
desc = "Toggle CodeCompanion";
desc = "Toggle CodeCompanion Chat";
};
}
{
mode = ["n" "v"];
key = "<leader>ta";
action = "<cmd>CodeCompanionActions<cr>";
options = {
silent = true;
desc = "Toggle CodeCompanion Actions";
};
}
];