diff --git a/nvim/.config/nvim/lua/plugins/ide.lua b/nvim/.config/nvim/lua/plugins/ide.lua index 1fe0a9e..47321bf 100644 --- a/nvim/.config/nvim/lua/plugins/ide.lua +++ b/nvim/.config/nvim/lua/plugins/ide.lua @@ -13,6 +13,8 @@ return { backends = { "treesitter", "lsp", "markdown", "man" }, }, }, + + -- lsp setup { "junnplus/lsp-setup.nvim", dependencies = { @@ -51,6 +53,7 @@ return { require("plugins.config.lsp") end, }, + -- completion setup { "hrsh7th/nvim-cmp", branch = "main", @@ -82,7 +85,88 @@ return { end, event = { "InsertEnter", "CmdlineEnter", "VeryLazy" }, }, + -- loading animations for some LSP { "j-hui/fidget.nvim", config = true, tag = "legacy", event = "VeryLazy" }, - -- a pretend-lsp for formatters and linters + + -- testing setup + { + "nvim-neotest/neotest", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim", + + "nvim-neotest/neotest-python", + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-python"), + }, + }) + for _, v in pairs(require("lazy").plugins()) do + if v[1] == "folke/which-key.nvim" then + require("which-key").register({ ["t"] = { name = "+test" } }) + break + end + end + end, + keys = { + { + "st", + [[lua require('neotest').summary.toggle()]], + desc = "toggle test list", + silent = true, + }, + { + "sT", + [[lua require('neotest').output_panel.toggle()]], + desc = "toggle test output", + silent = true, + }, + { + "to", + [[lua require('neotest').output.open()]], + desc = "toggle test output", + silent = true, + }, + { + "tt", + [[lua require('neotest').run.run()]], + desc = "run nearest test", + silent = true, + }, + { + "td", + [[lua require('neotest').run.run({strategy = "dap"})]], + desc = "debug nearest test", + silent = true, + }, -- REQUIRES DAP + { + "tT", + [[lua require('neotest').run.run(vim.fn.expand("%"))]], + desc = "test current file", + silent = true, + }, + { + "tr", + [[lua require('neotest').run.run_last()]], + desc = "re-run last test", + silent = true, + }, + { + "tw", + [[lua require('neotest').watch.toggle()]], + desc = "watch current test", + silent = true, + }, + { + "tW", + [[lua require('neotest').watch.toggle(vim.fn.expand("%"))]], + desc = "watch current file", + silent = true, + }, + }, + }, }