From 6ebf69abcaf0251739ca27f430641d59953c407b Mon Sep 17 00:00:00 2001 From: Alexander Zech <10773967+azech-hqs@users.noreply.github.com> Date: Wed, 29 Apr 2026 21:32:27 +0200 Subject: [PATCH 1/2] feat(opencode): set catppuccin theme --- opencode/tui.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 opencode/tui.json diff --git a/opencode/tui.json b/opencode/tui.json new file mode 100644 index 0000000..4000c27 --- /dev/null +++ b/opencode/tui.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://opencode.ai/tui.json", + "theme": "catppuccin" +} From 3f2a74bd28fa827951ceb620ab73f3327a3fd9fb Mon Sep 17 00:00:00 2001 From: Alexander Zech <10773967+azech-hqs@users.noreply.github.com> Date: Wed, 29 Apr 2026 23:08:51 +0200 Subject: [PATCH 2/2] feat(nvim): add opencode.nvim --- nvim/nvim-pack-lock.json | 4 ++++ nvim/plugin/opencode.lua | 33 +++++++++++++++++++++++++++++++++ nvim/plugin/snacks.lua | 15 ++++++++++++++- nvim/plugin/which_key.lua | 1 + 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 nvim/plugin/opencode.lua diff --git a/nvim/nvim-pack-lock.json b/nvim/nvim-pack-lock.json index 9eb83d2..257597d 100644 --- a/nvim/nvim-pack-lock.json +++ b/nvim/nvim-pack-lock.json @@ -112,6 +112,10 @@ "rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e", "src": "https://github.com/stevearc/oil.nvim" }, + "opencode.nvim": { + "rev": "0e3ae21c6c4c8def63e3503b238870f1251288e4", + "src": "https://github.com/nickjvandyke/opencode.nvim" + }, "plenary.nvim": { "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", "src": "https://github.com/nvim-lua/plenary.nvim" diff --git a/nvim/plugin/opencode.lua b/nvim/plugin/opencode.lua new file mode 100644 index 0000000..96643a9 --- /dev/null +++ b/nvim/plugin/opencode.lua @@ -0,0 +1,33 @@ +vim.pack.add({ "https://github.com/nickjvandyke/opencode.nvim" }) + +vim.o.autoread = true -- Required for `opts.events.reload` + +local opencode = require("opencode") + +vim.keymap.set({ "n", "x" }, "oa", function() + opencode.ask("@this: ", { submit = true }) +end, { desc = "Opencode: [A]sk" }) + +vim.keymap.set({ "n", "x" }, "ox", function() + opencode.select() +end, { desc = "Opencode: E[x]ecute action" }) + +vim.keymap.set("n", "ot", function() + opencode.toggle() +end, { desc = "Opencode: [T]oggle" }) + +-- Operators +vim.keymap.set({ "n", "x" }, "go", function() + return opencode.operator("@this ") +end, { desc = "Opencode: Add range", expr = true }) +vim.keymap.set("n", "goo", function() + return opencode.operator("@this ") .. "_" +end, { desc = "Opencode: Add line", expr = true }) + +-- Scrolling +vim.keymap.set("n", "", function() + opencode.command("session.half.page.up") +end, { desc = "Opencode: Scroll up" }) +vim.keymap.set("n", "", function() + opencode.command("session.half.page.down") +end, { desc = "Opencode: Scroll down" }) diff --git a/nvim/plugin/snacks.lua b/nvim/plugin/snacks.lua index 7c54778..cf30463 100644 --- a/nvim/plugin/snacks.lua +++ b/nvim/plugin/snacks.lua @@ -18,7 +18,20 @@ Snacks.setup({ input = {}, explorer = {}, lazygit = {}, - picker = {}, + picker = { + actions = { + opencode_send = function(...) + return require("opencode").snacks_picker_send(...) + end, + }, + win = { + input = { + keys = { + [""] = { "opencode_send", mode = { "n", "i" } }, + }, + }, + }, + }, scroll = { enabled = true }, statuscolumn = { enabled = true }, terminal = {}, diff --git a/nvim/plugin/which_key.lua b/nvim/plugin/which_key.lua index e0a78af..78403fb 100644 --- a/nvim/plugin/which_key.lua +++ b/nvim/plugin/which_key.lua @@ -12,6 +12,7 @@ require("which-key").setup({ { "h", group = "Git [H]unk" }, { "h_", hidden = true }, { "l", group = "[L]azygit" }, + { "o", group = "[O]pencode" }, { "r", group = "[R]ename" }, { "r_", hidden = true }, { "s", group = "[S]earch" },