diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 7b410c3..45ab42d 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -93,6 +93,7 @@ "oatmeal.nvim": { "branch": "master", "commit": "c8cdd0a182cf77f88ea5fa4703229ddb3f47c1f7" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "oil.nvim": { "branch": "master", "commit": "71948729cda5fc1b761d6ae60ff774b5525f1d50" }, + "opencode.nvim": { "branch": "main", "commit": "f8a3a88ad5c0c01102fedaacb1c612a4b874ed54" }, "persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, diff --git a/config/nvim/lua/plugins/lazygit.lua b/config/nvim/lua/plugins/lazygit.lua index 992eb05..5c8c1ca 100644 --- a/config/nvim/lua/plugins/lazygit.lua +++ b/config/nvim/lua/plugins/lazygit.lua @@ -1,18 +1,18 @@ -- Plugin for calling lazygit from within neovim. -- https://github.com/kdheepak/lazygit.nvim return { - "kdheepak/lazygit.nvim", - cmd = { - "LazyGit", - "LazyGitConfig", - "LazyGitCurrentFile", - "LazyGitFilter", - "LazyGitFilterCurrentFile", - }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { - { "lg", "LazyGit", desc = "LazyGit" }, - }, + "kdheepak/lazygit.nvim", + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + keys = { + { "lg", "LazyGit", desc = "LazyGit" }, + }, } diff --git a/config/nvim/lua/plugins/opencode.lua b/config/nvim/lua/plugins/opencode.lua new file mode 100644 index 0000000..db27857 --- /dev/null +++ b/config/nvim/lua/plugins/opencode.lua @@ -0,0 +1,46 @@ +-- Integrate the opencode AI assistant with Neovim — streamline editor-aware research, reviews, and requests. +-- https://github.com/NickvanDyke/opencode.nvim +return { + "NickvanDyke/opencode.nvim", + dependencies = { + { "folke/snacks.nvim", opts = { input = {}, picker = {} } }, + }, + config = function() + vim.g.opencode_opts = {} + + -- Required for `vim.g.opencode_opts.auto_reload` + vim.opt.autoread = true + + -- Recommended/example keymaps + vim.keymap.set({ "n", "x" }, "oa", function() + require("opencode").ask("@this: ", { submit = true }) + end, { desc = "Ask about this" }) + vim.keymap.set({ "n", "x" }, "os", function() + require("opencode").select() + end, { desc = "Select prompt" }) + vim.keymap.set({ "n", "x" }, "o+", function() + require("opencode").prompt("@this") + end, { desc = "Add this" }) + vim.keymap.set("n", "ot", function() + require("opencode").toggle() + end, { desc = "Toggle embedded" }) + vim.keymap.set("n", "oc", function() + require("opencode").command() + end, { desc = "Select command" }) + vim.keymap.set("n", "on", function() + require("opencode").command("session_new") + end, { desc = "New session" }) + vim.keymap.set("n", "oi", function() + require("opencode").command("session_interrupt") + end, { desc = "Interrupt session" }) + vim.keymap.set("n", "oA", function() + require("opencode").command("agent_cycle") + end, { desc = "Cycle selected agent" }) + vim.keymap.set("n", "", function() + require("opencode").command("messages_half_page_up") + end, { desc = "Messages half page up" }) + vim.keymap.set("n", "", function() + require("opencode").command("messages_half_page_down") + end, { desc = "Messages half page down" }) + end, +}