feat: opencode.nvim

This commit is contained in:
Anish Lakhwara 2025-12-24 17:25:55 -08:00
parent 5071c6cd2b
commit f61711c00d
No known key found for this signature in database
GPG key ID: 7FC5DF072EF7B716

View file

@ -90,6 +90,17 @@ let
sha256 = "czKjJgCpvRSdtR7rNGlJrluDgPIdx94KUyx33op5gdY=";
};
};
opencode-nvim = pkgs.vimUtils.buildVimPlugin {
pname = "opencode.nvim";
version = "2024-12-24";
src = pkgs.fetchFromGitHub {
owner = "NickvanDyke";
repo = "opencode.nvim";
rev = "dfca5bb214d78a600781d50da350238b3e6e2621";
hash = "sha256-W7fPGiLpKRe1Nw0MckigUijTNq+L9Z+vxOKcf3oNZf0=";
};
doCheck = false;
};
gh-addressed = pkgs.vimUtils.buildVimPlugin {
pname = "gh-addressed";
version = "2024-09-17";
@ -1013,6 +1024,22 @@ in
vim.keymap.set('n', '<M-S-k>', '<Cmd>resize +2<CR>', {silent = true})
vim.keymap.set('n', '<M-S-l>', '<Cmd>vertical resize +2<CR>', {silent = true})
-- opencode.nvim setup with tmux provider
vim.g.opencode_opts = {
provider = {
enabled = "tmux",
tmux = {
-- default tmux provider settings work well
},
},
}
-- opencode.nvim keybindings
vim.keymap.set({ "n", "x" }, "<leader>oa", function() require("opencode").ask("@this: ") end, { desc = "Ask opencode" })
vim.keymap.set({ "n", "x" }, "<leader>os", function() require("opencode").select() end, { desc = "Select opencode action" })
vim.keymap.set({ "n", "t" }, "<leader>oo", function() require("opencode").toggle() end, { desc = "Toggle opencode" })
vim.keymap.set({ "n", "x" }, "<leader>op", function() return require("opencode").operator("@this ") end, { expr = true, desc = "Add range to opencode" })
-- Kitaab recent files (only date-based files, sorted reverse)
function KitaabRecent()
local pickers = require('telescope.pickers')
@ -1174,6 +1201,9 @@ in
# custom
yuck-vim
nvim-parinfer
# opencode integration
opencode-nvim
# vim-processing
] ++ lib.optionals pkgs.stdenv.isLinux [
# Linux-only plugins