From 7bbb5ea812a3e9888ab4546f3c77d810f6fe6cc2 Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Sat, 13 Jun 2026 10:22:28 -0700 Subject: [PATCH] [Neovim] Adds Sidekick plugin. --- .../features/neovim/config/lazyvim.json | 3 +- .../neovim/config/lua/plugins/lsp.lua | 2 + .../neovim/config/lua/plugins/openscad.lua | 13 +++ .../neovim/config/lua/plugins/sidekick.lua | 95 +++++++++++++++++++ .../neovim/config/lua/plugins/snacks.lua | 5 + home-manager/features/neovim/default.nix | 1 + 6 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 home-manager/features/neovim/config/lua/plugins/openscad.lua create mode 100644 home-manager/features/neovim/config/lua/plugins/sidekick.lua diff --git a/home-manager/features/neovim/config/lazyvim.json b/home-manager/features/neovim/config/lazyvim.json index 310d3b9..cc0d62b 100644 --- a/home-manager/features/neovim/config/lazyvim.json +++ b/home-manager/features/neovim/config/lazyvim.json @@ -11,7 +11,8 @@ "lazyvim.plugins.extras.lang.rust", "lazyvim.plugins.extras.lang.tailwind", "lazyvim.plugins.extras.lang.toml", - "lazyvim.plugins.extras.lang.typescript" + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.ai.sidekick" ], "install_version": 8, "version": 8 diff --git a/home-manager/features/neovim/config/lua/plugins/lsp.lua b/home-manager/features/neovim/config/lua/plugins/lsp.lua index 13337eb..7fc605b 100644 --- a/home-manager/features/neovim/config/lua/plugins/lsp.lua +++ b/home-manager/features/neovim/config/lua/plugins/lsp.lua @@ -16,6 +16,8 @@ return { vtsls = {}, -- Haskell hls = {}, + -- Copilot + copilot = { enabled = true }, }, codelens = { enable = true, diff --git a/home-manager/features/neovim/config/lua/plugins/openscad.lua b/home-manager/features/neovim/config/lua/plugins/openscad.lua new file mode 100644 index 0000000..73ed42d --- /dev/null +++ b/home-manager/features/neovim/config/lua/plugins/openscad.lua @@ -0,0 +1,13 @@ +return { + "salkin-mada/openscad.nvim", + config = function() + vim.g.openscad_load_snippets = true + vim.g.openscad_default_mappings = true + vim.g.openscad_fuzzy_finder = "snacks" + require("openscad") + end, + dependencies = { + -- Can fall back to Snacks instead. + -- "ibhagwan/fzf-lua", + }, +} diff --git a/home-manager/features/neovim/config/lua/plugins/sidekick.lua b/home-manager/features/neovim/config/lua/plugins/sidekick.lua new file mode 100644 index 0000000..1930739 --- /dev/null +++ b/home-manager/features/neovim/config/lua/plugins/sidekick.lua @@ -0,0 +1,95 @@ +return { + -- https://github.com/folke/sidekick.nvim + "folke/sidekick.nvim", + opts = { + cli = { + mux = { + enabled = false, -- I haven't bothered to include tmux yet + backend = "tmux", + }, + }, + }, + keys = { + { + "", + function() + -- if there is a next edit, jump to it, otherwise apply it if any + if not require("sidekick").nes_jump_or_apply() then + return "" -- fallback to normal tab + end + end, + expr = true, + desc = "Goto/Apply Next Edit Suggestion", + }, + { + "", + function() + require("sidekick.cli").focus() + end, + desc = "Sidekick Focus", + mode = { "n", "t", "i", "x" }, + }, + { + "aa", + function() + require("sidekick.cli").toggle() + end, + desc = "Sidekick Toggle CLI", + }, + { + "as", + function() + require("sidekick.cli").select() + end, + -- Or to select only installed tools: + -- require("sidekick.cli").select({ filter = { installed = true } }) + desc = "Select CLI", + }, + { + "ad", + function() + require("sidekick.cli").close() + end, + desc = "Detach a CLI Session", + }, + { + "at", + function() + require("sidekick.cli").send({ msg = "{this}" }) + end, + mode = { "x", "n" }, + desc = "Send This", + }, + { + "af", + function() + require("sidekick.cli").send({ msg = "{file}" }) + end, + desc = "Send File", + }, + { + "av", + function() + require("sidekick.cli").send({ msg = "{selection}" }) + end, + mode = { "x" }, + desc = "Send Visual Selection", + }, + { + "ap", + function() + require("sidekick.cli").prompt() + end, + mode = { "n", "x" }, + desc = "Sidekick Select Prompt", + }, + -- Example of a keybinding to open Claude directly + -- { + -- "ac", + -- function() + -- require("sidekick.cli").toggle({ name = "claude", focus = true }) + -- end, + -- desc = "Sidekick Toggle Claude", + -- }, + }, +} diff --git a/home-manager/features/neovim/config/lua/plugins/snacks.lua b/home-manager/features/neovim/config/lua/plugins/snacks.lua index 3ebce1b..6f49bc2 100644 --- a/home-manager/features/neovim/config/lua/plugins/snacks.lua +++ b/home-manager/features/neovim/config/lua/plugins/snacks.lua @@ -2,6 +2,11 @@ return { "folke/snacks.nvim", opts = function(_, opts) vim.tbl_deep_extend("force", opts, { + styles = { + notification = { + wo = { wrap = true }, -- wrap notifications + }, + }, picker = { smart = { -- Remove the "recent" picker so we don't get things from other directories. diff --git a/home-manager/features/neovim/default.nix b/home-manager/features/neovim/default.nix index 252d72e..09ac224 100644 --- a/home-manager/features/neovim/default.nix +++ b/home-manager/features/neovim/default.nix @@ -21,6 +21,7 @@ sqlite # For Snacks imagemagick # For image conversion/display vscode-langservers-extracted # For language servers (it wants this version of eslint for some reason) + copilot-language-server # Enable the copilot language server ]; };