From 8755334d9d5b372d7984f13c06ffa0ea39fd55e1 Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Mon, 6 Oct 2025 11:00:58 +1100 Subject: [PATCH 1/2] feat: add `folke/sidekick.nvim` --- lua/astrocommunity/ai/sidekick-nivm/README.md | 5 ++ lua/astrocommunity/ai/sidekick-nivm/init.lua | 83 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 lua/astrocommunity/ai/sidekick-nivm/README.md create mode 100644 lua/astrocommunity/ai/sidekick-nivm/init.lua diff --git a/lua/astrocommunity/ai/sidekick-nivm/README.md b/lua/astrocommunity/ai/sidekick-nivm/README.md new file mode 100644 index 000000000..30271a9d9 --- /dev/null +++ b/lua/astrocommunity/ai/sidekick-nivm/README.md @@ -0,0 +1,5 @@ +# folke/sidekick.nvim + +Your Neovim AI sidekick + +**Repository**: diff --git a/lua/astrocommunity/ai/sidekick-nivm/init.lua b/lua/astrocommunity/ai/sidekick-nivm/init.lua new file mode 100644 index 000000000..0c7f5f9b5 --- /dev/null +++ b/lua/astrocommunity/ai/sidekick-nivm/init.lua @@ -0,0 +1,83 @@ +local cli_tool = vim.g.sidekick_cli_tool or "opencode" +local prefix = "A" + +---@type LazySpec +return { + "folke/sidekick.nvim", + specs = { + { + "AstroNvim/astrocore", + ---@param opts AstroCoreOpts + opts = function(_, opts) + local maps = assert(opts.mappings) + maps.n[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" } + maps.x[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" } + end, + }, + { "AstroNvim/astroui", opts = { icons = { Sidekick = "" } } }, + }, + opts = { + nes = { + enabled = true, -- If the user doesn't have the copilot LSP running internally this gets set as false + }, + cli = { + mux = { + enabled = true, + }, + }, + }, + keys = { + { + "", + function() + if not require("sidekick").nes_jump_or_apply() then return "" end + end, + expr = true, + desc = "Goto/Apply Next Edit Suggestion", + }, + { + "", + function() require("sidekick.cli").toggle { name = cli_tool } end, + desc = "Sidekick Toggle", + mode = { "n", "t", "i", "x" }, + }, + { + prefix .. "a", + function() require("sidekick.cli").toggle { name = cli_tool } end, + desc = "Sidekick Toggle CLI", + }, + { + prefix .. "s", + function() require("sidekick.cli").select { name = cli_tool } end, + desc = "Select CLI", + }, + { + prefix .. "d", + function() require("sidekick.cli").close { name = cli_tool } end, + desc = "Detach a CLI Session", + }, + { + prefix .. "t", + function() require("sidekick.cli").send { name = cli_tool, msg = "{this}" } end, + mode = { "x", "n" }, + desc = "Send This", + }, + { + prefix .. "f", + function() require("sidekick.cli").send { name = cli_tool, msg = "{file}" } end, + desc = "Send File", + }, + { + prefix .. "v", + function() require("sidekick.cli").send { name = cli_tool, msg = "{selection}" } end, + mode = { "x" }, + desc = "Send Visual Selection", + }, + { + prefix .. "p", + function() require("sidekick.cli").prompt { name = cli_tool } end, + mode = { "n", "x" }, + desc = "Sidekick Select Prompt", + }, + }, +} From f79ce4aaf37adad8da40351606467ff4f27c6305 Mon Sep 17 00:00:00 2001 From: Nicholas Ciechanowski Date: Tue, 18 Nov 2025 21:19:26 +1100 Subject: [PATCH 2/2] feat: add `folke/sidekick.nvim` --- lua/astrocommunity/ai/sidekick-nivm/init.lua | 83 ------------- .../README.md | 0 lua/astrocommunity/ai/sidekick-nvim/init.lua | 113 ++++++++++++++++++ 3 files changed, 113 insertions(+), 83 deletions(-) delete mode 100644 lua/astrocommunity/ai/sidekick-nivm/init.lua rename lua/astrocommunity/ai/{sidekick-nivm => sidekick-nvim}/README.md (100%) create mode 100644 lua/astrocommunity/ai/sidekick-nvim/init.lua diff --git a/lua/astrocommunity/ai/sidekick-nivm/init.lua b/lua/astrocommunity/ai/sidekick-nivm/init.lua deleted file mode 100644 index 0c7f5f9b5..000000000 --- a/lua/astrocommunity/ai/sidekick-nivm/init.lua +++ /dev/null @@ -1,83 +0,0 @@ -local cli_tool = vim.g.sidekick_cli_tool or "opencode" -local prefix = "A" - ----@type LazySpec -return { - "folke/sidekick.nvim", - specs = { - { - "AstroNvim/astrocore", - ---@param opts AstroCoreOpts - opts = function(_, opts) - local maps = assert(opts.mappings) - maps.n[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" } - maps.x[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" } - end, - }, - { "AstroNvim/astroui", opts = { icons = { Sidekick = "" } } }, - }, - opts = { - nes = { - enabled = true, -- If the user doesn't have the copilot LSP running internally this gets set as false - }, - cli = { - mux = { - enabled = true, - }, - }, - }, - keys = { - { - "", - function() - if not require("sidekick").nes_jump_or_apply() then return "" end - end, - expr = true, - desc = "Goto/Apply Next Edit Suggestion", - }, - { - "", - function() require("sidekick.cli").toggle { name = cli_tool } end, - desc = "Sidekick Toggle", - mode = { "n", "t", "i", "x" }, - }, - { - prefix .. "a", - function() require("sidekick.cli").toggle { name = cli_tool } end, - desc = "Sidekick Toggle CLI", - }, - { - prefix .. "s", - function() require("sidekick.cli").select { name = cli_tool } end, - desc = "Select CLI", - }, - { - prefix .. "d", - function() require("sidekick.cli").close { name = cli_tool } end, - desc = "Detach a CLI Session", - }, - { - prefix .. "t", - function() require("sidekick.cli").send { name = cli_tool, msg = "{this}" } end, - mode = { "x", "n" }, - desc = "Send This", - }, - { - prefix .. "f", - function() require("sidekick.cli").send { name = cli_tool, msg = "{file}" } end, - desc = "Send File", - }, - { - prefix .. "v", - function() require("sidekick.cli").send { name = cli_tool, msg = "{selection}" } end, - mode = { "x" }, - desc = "Send Visual Selection", - }, - { - prefix .. "p", - function() require("sidekick.cli").prompt { name = cli_tool } end, - mode = { "n", "x" }, - desc = "Sidekick Select Prompt", - }, - }, -} diff --git a/lua/astrocommunity/ai/sidekick-nivm/README.md b/lua/astrocommunity/ai/sidekick-nvim/README.md similarity index 100% rename from lua/astrocommunity/ai/sidekick-nivm/README.md rename to lua/astrocommunity/ai/sidekick-nvim/README.md diff --git a/lua/astrocommunity/ai/sidekick-nvim/init.lua b/lua/astrocommunity/ai/sidekick-nvim/init.lua new file mode 100644 index 000000000..72fa8aaef --- /dev/null +++ b/lua/astrocommunity/ai/sidekick-nvim/init.lua @@ -0,0 +1,113 @@ +---@type LazySpec +return { + "folke/sidekick.nvim", + specs = { + { + "AstroNvim/astrocore", + ---@param opts AstroCoreOpts + opts = function(_, opts) + local maps = assert(opts.mappings) + local prefix = "A" + + -- Normal mode mappings + maps.n[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" } + maps.n[prefix .. "a"] = { + function() require("sidekick.cli").toggle() end, + desc = "Sidekick Toggle CLI", + } + maps.n[prefix .. "s"] = { + function() require("sidekick.cli").select() end, + desc = "Select CLI", + } + maps.n[prefix .. "d"] = { + function() require("sidekick.cli").close() end, + desc = "Detach a CLI Session", + } + maps.n[prefix .. "t"] = { + function() require("sidekick.cli").send { msg = "{this}" } end, + desc = "Send This", + } + maps.n[prefix .. "f"] = { + function() require("sidekick.cli").send { msg = "{file}" } end, + desc = "Send File", + } + maps.n[prefix .. "p"] = { + function() require("sidekick.cli").prompt() end, + desc = "Select Prompt", + } + + maps.n[prefix .. "n"] = { desc = require("astroui").get_icon("SidekickBrain", 1, true) .. "NES" } + maps.n[prefix .. "nt"] = { + function() require("sidekick.nes").toggle() end, + desc = "Toggle NES", + } + maps.n[prefix .. "ne"] = { + function() require("sidekick.nes").enable() end, + desc = "Enable NES", + } + maps.n[prefix .. "nd"] = { + function() require("sidekick.nes").disable() end, + desc = "Disable NES", + } + maps.n[prefix .. "nu"] = { + function() require("sidekick.nes").update() end, + desc = "Update Suggestions", + } + + maps.n[""] = { + function() + if not require("sidekick").nes_jump_or_apply() then return "" end + end, + expr = true, + desc = "Goto/Apply Next Edit Suggestion", + } + maps.n[""] = { + function() require("sidekick.cli").toggle {} end, + desc = "Sidekick Toggle", + } + + -- Visual mode mappings + maps.x[prefix] = { desc = require("astroui").get_icon("Sidekick", 1, true) .. "Sidekick" } + maps.x[prefix .. "t"] = { + function() require("sidekick.cli").send { msg = "{this}" } end, + desc = "Send This", + } + maps.x[prefix .. "v"] = { + function() require("sidekick.cli").send { msg = "{selection}" } end, + desc = "Send Visual Selection", + } + maps.x[prefix .. "p"] = { + function() require("sidekick.cli").prompt {} end, + desc = "Select Prompt", + } + maps.x[""] = { + function() require("sidekick.cli").toggle {} end, + desc = "Sidekick Toggle", + } + + -- Insert mode mappings + maps.i[""] = { + function() require("sidekick.cli").toggle {} end, + desc = "Sidekick Toggle", + } + + -- Terminal mode mappings + maps.t[""] = { + function() require("sidekick.cli").toggle {} end, + desc = "Sidekick Toggle", + } + end, + }, + { "AstroNvim/astroui", opts = { icons = { Sidekick = "", SidekickBrain = "󰧑" } } }, + }, + opts = { + nes = { + enabled = true, -- If the user doesn't have the copilot LSP running internally this gets set as false + }, + cli = { + mux = { + enabled = true, + }, + }, + }, +}