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