diff --git a/init.lua b/init.lua index c902d72..0dc362d 100644 --- a/init.lua +++ b/init.lua @@ -37,6 +37,7 @@ require("lazy").setup({ require("plugins.ai"), require("plugins.orgmode"), require("plugins.lsp"), + require("plugins.neotest"), require("plugins.treesitter"), require("plugins.dap"), require("plugins.haunt"), diff --git a/lazy-lock.json b/lazy-lock.json index f06b3cd..d894252 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,6 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "bento.nvim": { "branch": "main", "commit": "aee8a542bc1839ff1764992ef2aa41c981d0bba4" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "codecompanion.nvim": { "branch": "main", "commit": "f70759ee8b63b46ea0cf158dc22daa2a5e9c6319" }, @@ -27,12 +28,14 @@ "lualine.nvim": { "branch": "master", "commit": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c" }, "mason.nvim": { "branch": "main", "commit": "cb8445f8ce85d957416c106b780efd51c6298f89" }, "neogit": { "branch": "master", "commit": "792c139da736230855e8341ebe6175bb6eb8268b" }, + "neotest": { "branch": "master", "commit": "ad991822b7076b1d940b33a9d6d0d30416d5df81" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, "nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" }, "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, "nvim-jdtls": { "branch": "master", "commit": "77ccaeb422f8c81b647605da5ddb4a7f725cda90" }, "nvim-lspconfig": { "branch": "master", "commit": "8fde495949782bb61c2605174e231d145a048d8c" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" }, "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, @@ -43,7 +46,9 @@ "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "08783ec022e7ddefe0f12a16f1ac4968f55478b0" }, + "rustaceanvim": { "branch": "main", "commit": "a60811ae6054ba981cb4693aaecd715dea783327" }, "scrollEOF.nvim": { "branch": "master", "commit": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7" }, + "sidekick.nvim": { "branch": "main", "commit": "208e1c5b8170c01fd1d07df0139322a76479b235" }, "snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, diff --git a/lsp/rust-analyzer.lua b/lsp/rust-analyzer.lua deleted file mode 100644 index e69de29..0000000 diff --git a/lua/keymap.lua b/lua/keymap.lua index 5bb3cfc..33153c1 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -13,6 +13,8 @@ vim.keymap.set({ "n", "v" }, "y", '"+y') -- Editor vim.keymap.set("i", "", "+", { noremap = true, silent = true, desc = "Paste from system clipboard" }) +vim.keymap.set("i", "jj", "", { noremap = true, silent = true, desc = "Exit insert mode" }) +vim.keymap.set("t", "jj", "", { noremap = true, silent = true, desc = "Exit terminal mode" }) -- LSP vim.keymap.set( diff --git a/lua/plugins/ai.lua b/lua/plugins/ai.lua index afeddf2..4eda4a5 100644 --- a/lua/plugins/ai.lua +++ b/lua/plugins/ai.lua @@ -60,6 +60,101 @@ local M = { "nvim-treesitter/nvim-treesitter", }, }, + { + "folke/sidekick.nvim", + opts = { + -- add any options here + cli = { + mux = { + backend = "zellij", + enabled = true, + }, + }, + }, + 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", + }, + }, + }, } return M diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 4a5023d..e5794e4 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -2,13 +2,14 @@ local M = { { "neovim/nvim-lspconfig", config = function() - vim.lsp.enable("rust_analyzer") + -- vim.lsp.enable("rust_analyzer") vim.lsp.enable("yamlls") vim.lsp.enable("luals") vim.lsp.enable("sqls") vim.lsp.enable("ty") vim.lsp.enable("svelte") - vim.lsp.enable("harper_ls") + vim.lsp.enable("sourcekit") + vim.lsp.enable("harper_ls") -- Setup gopls with inlay hints vim.lsp.config("gopls", { @@ -71,6 +72,11 @@ local M = { event = { "CmdlineEnter" }, ft = { "go", "gomod" }, }, + { + "mrcjkb/rustaceanvim", + version = "^9", + lazy = false, + }, { "saghen/blink.cmp", dependencies = { "rafamadriz/friendly-snippets" }, diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua new file mode 100644 index 0000000..8efe54a --- /dev/null +++ b/lua/plugins/neotest.lua @@ -0,0 +1,20 @@ +local M = { + { + "nvim-neotest/neotest", + event = "VeryLazy", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + }, + config = function() + require("neotest").setup({ + adapters = { + require("rustaceanvim.neotest") + }, + }) + end, + }, +} + +return M