From 2d56b443fc884f9023baa5d49829725d9a3d988f Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 9 Jun 2025 12:26:42 +0200 Subject: [PATCH] Change copilot plugn --- modules/cli/tools/tmux.nix | 2 ++ modules/cli/zsh/default.nix | 1 + nvim/default.nix | 5 +++-- nvim/lua/plugins/blink.lua | 3 +++ nvim/lua/plugins/copilot.lua | 42 +++++++++++++++++++++++++----------- 5 files changed, 38 insertions(+), 15 deletions(-) diff --git a/modules/cli/tools/tmux.nix b/modules/cli/tools/tmux.nix index 13f9e64..7717410 100644 --- a/modules/cli/tools/tmux.nix +++ b/modules/cli/tools/tmux.nix @@ -26,6 +26,7 @@ '' set -g status off set -s set-clipboard on + set -g extended-keys on # from tmux-sensible set -g display-time 4000 @@ -52,6 +53,7 @@ # suspend inner tmux (to allow nested sessions) bind @ { set prefix None; set key-table off } + # NOTE: C-@ doesn't work since v3.5a bind -T off C-@ { set -u prefix; set -u key-table } ''; }; diff --git a/modules/cli/zsh/default.nix b/modules/cli/zsh/default.nix index f3ee728..bbac238 100644 --- a/modules/cli/zsh/default.nix +++ b/modules/cli/zsh/default.nix @@ -292,6 +292,7 @@ rename # this is perl-rename gfold lsof + bitwarden-cli ] ++ lib.optionals pkgs.stdenv.isLinux [ usbutils diff --git a/nvim/default.nix b/nvim/default.nix index b3e6a3a..01bc4fa 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -63,7 +63,7 @@ in nvim-lspconfig (blink-cmp.overrideAttrs { # clashes with oil - postPatch = "rm doc/recipes.md"; + postPatch = "rm -rf doc/"; }) SchemaStore-nvim roslyn-nvim @@ -108,7 +108,8 @@ in nvim-navic virt-column-nvim - CopilotChat-nvim + render-markdown-nvim + codecompanion-nvim # enable this just to signin (used by the chat plugin above) # (copilot-vim.overrideAttrs { # postPatch = "rm doc/copilot.txt"; diff --git a/nvim/lua/plugins/blink.lua b/nvim/lua/plugins/blink.lua index 38cf09f..a552555 100644 --- a/nvim/lua/plugins/blink.lua +++ b/nvim/lua/plugins/blink.lua @@ -49,6 +49,9 @@ return { return { "lsp" } end, + per_filetype = { + codecompanion = { "codecompanion" }, + } }, }, after = function(plug) diff --git a/nvim/lua/plugins/copilot.lua b/nvim/lua/plugins/copilot.lua index 05a97a0..9a8fcdc 100644 --- a/nvim/lua/plugins/copilot.lua +++ b/nvim/lua/plugins/copilot.lua @@ -1,30 +1,46 @@ return { { - "CopilotChat.nvim", + "codecompanion", keys = { { "l", - "CopilotChatToggle", + "CodeCompanionChat Toggle", desc = "Copilot", mode = { "n", "v" }, } }, opts = { - model = "gemini-2.5-pro", - chat_autocomplete = false, - auto_insert_mode = true, - mappings = { - complete = { - insert = "", + strategies = { + chat = { + adapter = "copilot", + model = "claude-3-7-sonnet", + start_in_insert_mode = true, + keymaps = { + send = { + modes = { n = "", i = "" }, + }, + close = { + modes = { n = "q", i = "" }, + }, + }, }, - close = { - normal = "q", - insert = "", + inline = { + adapter = "copilot", + model = "claude-3-7-sonnet", }, - } + }, }, after = function(plug) - require("CopilotChat").setup(plug.opts) + require("codecompanion").setup(plug.opts) + end, + }, + + { + "render-markdown", + ft = { "markdown", "codecompanion" }, + opts = {}, + after = function(plug) + require("render-markdown").setup(plug.opts) end, }, }