return { { "folke/which-key.nvim", optional = true, opts = { defaults = { ["t"] = { name = "+test" }, }, }, }, { "nvim-neotest/neotest", opts = { adapter_config = { -- ["adapter_name"] = {} -- set adapter config here }, adapters = {}, }, config = function(_, opts) local neotest_ns = vim.api.nvim_create_namespace("neotest") vim.diagnostic.config({ virtual_text = { format = function(diagnostic) -- Replace newline and tab characters with space for more compact diagnostics local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "") return message end, }, }, neotest_ns) if opts.adapter_config then for a, adapter in ipairs(opts.adapters or {}) do local name = adapter.name if opts.adapter_config[name] then opts.adapters[a] = adapter(opts.adapter_config[name]) end end end require("neotest").setup(opts) end, -- stylua: ignore keys = { { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, { "tR", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, { "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" }, }, }, { "mfussenegger/nvim-dap", optional = true, -- stylua: ignore keys = { { "td", function() require("neotest").run.run({strategy = "dap"}) end, desc = "Debug Nearest" }, }, }, }