From a42a45bdc195af5ffccbde37b7a2fba8ed212901 Mon Sep 17 00:00:00 2001 From: jasmine Date: Mon, 17 Feb 2025 22:15:49 +0800 Subject: [PATCH] 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. --- config/plugins/utils/codecompanion.nix | 57 +++++++++++++++++--------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/config/plugins/utils/codecompanion.nix b/config/plugins/utils/codecompanion.nix index ccb4004..4c90dfe 100644 --- a/config/plugins/utils/codecompanion.nix +++ b/config/plugins/utils/codecompanion.nix @@ -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 = "tc"; - action = "CodeCompanionChat Toggle"; + action = "CodeCompanionChat"; options = { silent = true; - desc = "Toggle CodeCompanion"; + desc = "Toggle CodeCompanion Chat"; + }; + } + + { + mode = ["n" "v"]; + key = "ta"; + action = "CodeCompanionActions"; + options = { + silent = true; + desc = "Toggle CodeCompanion Actions"; }; } ];