mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 12:15:29 +00:00
feat(nvim): add opencode plugin
This commit is contained in:
@@ -93,6 +93,7 @@
|
|||||||
"oatmeal.nvim": { "branch": "master", "commit": "c8cdd0a182cf77f88ea5fa4703229ddb3f47c1f7" },
|
"oatmeal.nvim": { "branch": "master", "commit": "c8cdd0a182cf77f88ea5fa4703229ddb3f47c1f7" },
|
||||||
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
||||||
"oil.nvim": { "branch": "master", "commit": "71948729cda5fc1b761d6ae60ff774b5525f1d50" },
|
"oil.nvim": { "branch": "master", "commit": "71948729cda5fc1b761d6ae60ff774b5525f1d50" },
|
||||||
|
"opencode.nvim": { "branch": "main", "commit": "f8a3a88ad5c0c01102fedaacb1c612a4b874ed54" },
|
||||||
"persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" },
|
"persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
-- Plugin for calling lazygit from within neovim.
|
-- Plugin for calling lazygit from within neovim.
|
||||||
-- https://github.com/kdheepak/lazygit.nvim
|
-- https://github.com/kdheepak/lazygit.nvim
|
||||||
return {
|
return {
|
||||||
"kdheepak/lazygit.nvim",
|
"kdheepak/lazygit.nvim",
|
||||||
cmd = {
|
cmd = {
|
||||||
"LazyGit",
|
"LazyGit",
|
||||||
"LazyGitConfig",
|
"LazyGitConfig",
|
||||||
"LazyGitCurrentFile",
|
"LazyGitCurrentFile",
|
||||||
"LazyGitFilter",
|
"LazyGitFilter",
|
||||||
"LazyGitFilterCurrentFile",
|
"LazyGitFilterCurrentFile",
|
||||||
},
|
},
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
46
config/nvim/lua/plugins/opencode.lua
Normal file
46
config/nvim/lua/plugins/opencode.lua
Normal file
@@ -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" }, "<leader>oa", function()
|
||||||
|
require("opencode").ask("@this: ", { submit = true })
|
||||||
|
end, { desc = "Ask about this" })
|
||||||
|
vim.keymap.set({ "n", "x" }, "<leader>os", function()
|
||||||
|
require("opencode").select()
|
||||||
|
end, { desc = "Select prompt" })
|
||||||
|
vim.keymap.set({ "n", "x" }, "<leader>o+", function()
|
||||||
|
require("opencode").prompt("@this")
|
||||||
|
end, { desc = "Add this" })
|
||||||
|
vim.keymap.set("n", "<leader>ot", function()
|
||||||
|
require("opencode").toggle()
|
||||||
|
end, { desc = "Toggle embedded" })
|
||||||
|
vim.keymap.set("n", "<leader>oc", function()
|
||||||
|
require("opencode").command()
|
||||||
|
end, { desc = "Select command" })
|
||||||
|
vim.keymap.set("n", "<leader>on", function()
|
||||||
|
require("opencode").command("session_new")
|
||||||
|
end, { desc = "New session" })
|
||||||
|
vim.keymap.set("n", "<leader>oi", function()
|
||||||
|
require("opencode").command("session_interrupt")
|
||||||
|
end, { desc = "Interrupt session" })
|
||||||
|
vim.keymap.set("n", "<leader>oA", function()
|
||||||
|
require("opencode").command("agent_cycle")
|
||||||
|
end, { desc = "Cycle selected agent" })
|
||||||
|
vim.keymap.set("n", "<S-C-u>", function()
|
||||||
|
require("opencode").command("messages_half_page_up")
|
||||||
|
end, { desc = "Messages half page up" })
|
||||||
|
vim.keymap.set("n", "<S-C-d>", function()
|
||||||
|
require("opencode").command("messages_half_page_down")
|
||||||
|
end, { desc = "Messages half page down" })
|
||||||
|
end,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user