return { { "nvim-neotest/neotest", dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", "antoinemadec/FixCursorHold.nvim", "nvim-neotest/neotest-python", "rouge8/neotest-rust", "nvim-neotest/neotest-go", }, keys = { { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run buffer" }, { "tT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run all files" }, { "tr", function() require("neotest").run.run() end, desc = "Run nearest test" }, { "td", function() require("neotest").run.run({strategy="dap"}) end, desc = "Debug nearest test" }, { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle summary" }, { "to", function() require("neotest").output.open({enter=true, auto_close=true}) end, desc = "Show output" }, { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle output panel" }, { "tS", function() require("neotest").run.stop() end, desc = "Stop" }, { "twt", function() require("neotest").watch.watch(vim.fn.expand("%")) end, desc = "Watch buffer" }, { "twT", function() require("neotest").watch.watch(vim.loop.cwd()) end, desc = "Watch all files" }, { "twr", function() require("neotest").watch.watch() end, desc = "Watch nearest test" }, { "tws", function() require("neotest").watch.stop() end, desc = "Stop watching" }, }, config = function() local neotest_ns = vim.api.nvim_create_namespace("neotest") vim.diagnostic.config({ virtual_text = { format = function(diagnostic) return diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "") end, }, }, neotest_ns) require("neotest").setup({ adapters = { require("neotest-python"), require("neotest-rust"), require("neotest-go"), }, }) end, }, }