From d4ede85a4354591265ef7f49ee90392912e95820 Mon Sep 17 00:00:00 2001 From: Paul-Henri Froidmont Date: Mon, 8 Dec 2025 02:40:50 +0100 Subject: [PATCH] Add opencode.nvim --- modules/desktop/terminal.nix | 2 ++ modules/editor/vim/lua/plugins/opencode.lua | 31 +++++++++++++++++++++ modules/editor/vim/vim.nix | 11 ++++++++ 3 files changed, 44 insertions(+) create mode 100644 modules/editor/vim/lua/plugins/opencode.lua diff --git a/modules/desktop/terminal.nix b/modules/desktop/terminal.nix index 314d110..2aa5375 100644 --- a/modules/desktop/terminal.nix +++ b/modules/desktop/terminal.nix @@ -18,6 +18,8 @@ in font_family = "Meslo LG S"; font_size = 10; symbol_map = "U+e000-U+e00a,U+ea60-U+ebeb,U+e0a0-U+e0c8,U+e0ca,U+e0cc-U+e0d4,U+e200-U+e2a9,U+e300-U+e3e3,U+e5fa-U+e6b1,U+e700-U+e7c5,U+f000-U+f2e0,U+f300-U+f372,U+f400-U+f532,U+f0001-U+f1af0 Symbols Nerd Font Mono"; + allow_remote_control = "yes"; + listen_on = "unix:@mykitty"; }; keybindings = { "ctrl+up" = "change_font_size all +2.0"; diff --git a/modules/editor/vim/lua/plugins/opencode.lua b/modules/editor/vim/lua/plugins/opencode.lua new file mode 100644 index 0000000..4847b23 --- /dev/null +++ b/modules/editor/vim/lua/plugins/opencode.lua @@ -0,0 +1,31 @@ +return { + "NickvanDyke/opencode.nvim", + config = function() + ---@type opencode.Opts + vim.g.opencode_opts = { + provider = { + enabled = "kitty", + kitty = { + location = "tab" + } + } + } + vim.o.autoread = true + + vim.keymap.set({ "n", "x" }, "oa", function() + require("opencode").ask("@this: ", { submit = true }) + end, { desc = "Ask opencode" }) + + vim.keymap.set({ "n", "x" }, "oo", function() + require("opencode").select() + end, { desc = "Execute opencode action…" }) + + vim.keymap.set({ "n", "x" }, "os", function() + require("opencode").prompt("@this") + end, { desc = "Add to opencode" }) + + vim.keymap.set({ "n", "t" }, "o.", function() + require("opencode").toggle() + end, { desc = "Toggle opencode" }) + end, +} diff --git a/modules/editor/vim/vim.nix b/modules/editor/vim/vim.nix index ea5e8a3..3896622 100644 --- a/modules/editor/vim/vim.nix +++ b/modules/editor/vim/vim.nix @@ -138,6 +138,17 @@ in avante-nvim blink-cmp-avante img-clip-nvim + + (pkgs.vimUtils.buildVimPlugin { + pname = "opencode.nvim"; + version = "2025-12-04"; + src = pkgs.fetchFromGitHub { + owner = "NickvanDyke"; + repo = "opencode.nvim"; + rev = "963fad75f794deb85d1c310d2e2cb033da44f670"; + hash = "sha256-nKOsHgMptHnOS+SCTHa77sQ/ZiUY0aW26I8GN7ocRHE="; + }; + }) ]; extraPackages = with pkgs; [