diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-31 16:36:49 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-31 16:36:49 +0900 |
| commit | a978fdfa944c9fb8ee444a0f2d4f1ae8f53a4b67 (patch) | |
| tree | f85ea169496c03910b93f2b53ef8a81f75513769 | |
| parent | 12e1fd00797fbda0195cdbd77792c8fb1ea0eb85 (diff) | |
modified plugins/ai.lua, modified plugins/ai.lua
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua | 47 | ||||
| -rw-r--r-- | mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua | 47 |
2 files changed, 94 insertions, 0 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua index 6ff4ac6..52ceb01 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua @@ -260,6 +260,53 @@ return { }, }, { + "NickvanDyke/opencode.nvim", + dependencies = { + -- Recommended for `ask()` and `select()`. + -- Required for `snacks` provider. + ---@module 'snacks' <- Loads `snacks.nvim` types for configuration intellisense. + { "folke/snacks.nvim", opts = { input = {}, picker = {}, terminal = {} } }, + }, + config = function() + ---@type opencode.Opts + vim.g.opencode_opts = { + -- Your configuration, if any — see `lua/opencode/config.lua`, or "goto definition". + } + + -- Required for `opts.events.reload`. + vim.o.autoread = true + + -- Recommended/example keymaps. + vim.keymap.set({ "n", "x" }, "<C-a>", function() + require("opencode").ask("@this: ", { submit = true }) + end, { desc = "Ask opencode" }) + vim.keymap.set({ "n", "x" }, "<C-x>", function() + require("opencode").select() + end, { desc = "Execute opencode action…" }) + vim.keymap.set({ "n", "t" }, "<C-.>", function() + require("opencode").toggle() + end, { desc = "Toggle opencode" }) + + vim.keymap.set({ "n", "x" }, "go", function() + return require("opencode").operator("@this ") + end, { expr = true, desc = "Add range to opencode" }) + vim.keymap.set("n", "goo", function() + return require("opencode").operator("@this ") .. "_" + end, { expr = true, desc = "Add line to opencode" }) + + vim.keymap.set("n", "<S-C-u>", function() + require("opencode").command("session.half.page.up") + end, { desc = "opencode half page up" }) + vim.keymap.set("n", "<S-C-d>", function() + require("opencode").command("session.half.page.down") + end, { desc = "opencode half page down" }) + + -- You may want these if you stick with the opinionated "<C-a>" and "<C-x>" above — otherwise consider "<leader>o". + vim.keymap.set("n", "+", "<C-a>", { desc = "Increment", noremap = true }) + vim.keymap.set("n", "-", "<C-x>", { desc = "Decrement", noremap = true }) + end, + }, + { "kkrampis/codex.nvim", lazy = true, cmd = { "Codex", "CodexToggle" }, -- Optional: Load only on command execution diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua index 6ff4ac6..52ceb01 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua @@ -260,6 +260,53 @@ return { }, }, { + "NickvanDyke/opencode.nvim", + dependencies = { + -- Recommended for `ask()` and `select()`. + -- Required for `snacks` provider. + ---@module 'snacks' <- Loads `snacks.nvim` types for configuration intellisense. + { "folke/snacks.nvim", opts = { input = {}, picker = {}, terminal = {} } }, + }, + config = function() + ---@type opencode.Opts + vim.g.opencode_opts = { + -- Your configuration, if any — see `lua/opencode/config.lua`, or "goto definition". + } + + -- Required for `opts.events.reload`. + vim.o.autoread = true + + -- Recommended/example keymaps. + vim.keymap.set({ "n", "x" }, "<C-a>", function() + require("opencode").ask("@this: ", { submit = true }) + end, { desc = "Ask opencode" }) + vim.keymap.set({ "n", "x" }, "<C-x>", function() + require("opencode").select() + end, { desc = "Execute opencode action…" }) + vim.keymap.set({ "n", "t" }, "<C-.>", function() + require("opencode").toggle() + end, { desc = "Toggle opencode" }) + + vim.keymap.set({ "n", "x" }, "go", function() + return require("opencode").operator("@this ") + end, { expr = true, desc = "Add range to opencode" }) + vim.keymap.set("n", "goo", function() + return require("opencode").operator("@this ") .. "_" + end, { expr = true, desc = "Add line to opencode" }) + + vim.keymap.set("n", "<S-C-u>", function() + require("opencode").command("session.half.page.up") + end, { desc = "opencode half page up" }) + vim.keymap.set("n", "<S-C-d>", function() + require("opencode").command("session.half.page.down") + end, { desc = "opencode half page down" }) + + -- You may want these if you stick with the opinionated "<C-a>" and "<C-x>" above — otherwise consider "<leader>o". + vim.keymap.set("n", "+", "<C-a>", { desc = "Increment", noremap = true }) + vim.keymap.set("n", "-", "<C-x>", { desc = "Decrement", noremap = true }) + end, + }, + { "kkrampis/codex.nvim", lazy = true, cmd = { "Codex", "CodexToggle" }, -- Optional: Load only on command execution |
