chore: Remove neovim clutter

This commit is contained in:
Fabio Lenherr / DashieTM 2023-11-18 00:55:43 +01:00
parent af4dc010b8
commit 293c4965df
4 changed files with 6 additions and 205 deletions

View file

@ -168,101 +168,6 @@ return {
{
"mg979/vim-visual-multi",
},
{
"rouge8/neotest-rust",
},
{
"Issafalcon/neotest-dotnet",
},
{
"andy-bell101/neotest-java",
},
{
"nvim-neotest/neotest-go",
},
{
"nvim-neotest/neotest-python",
},
{
"nvim-neotest/neotest",
dependencies = {
"rouge8/neotest-rust",
"Issafalcon/neotest-dotnet",
"andy-bell101/neotest-java",
"nvim-neotest/neotest-go",
"nvim-neotest/neotest-python",
},
opts = {
adapters = {
["neotest-rust"] = {},
["neotest-dotnet"] = {},
["neotest-java"] = {},
["neotest-go"] = {},
["neotest-python"] = {},
},
status = { virtual_text = true },
output = { open_on_run = true },
quickfix = {
open = function()
if require("lazyvim.util").has("trouble.nvim") then
vim.cmd("Trouble quickfix")
else
vim.cmd("copen")
end
end,
},
},
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.adapters then
local adapters = {}
for name, config in pairs(opts.adapters or {}) do
if type(name) == "number" then
if type(config) == "string" then
config = require(config)
end
adapters[#adapters + 1] = config
elseif config ~= false then
local adapter = require(name)
if type(config) == "table" and not vim.tbl_isempty(config) then
local meta = getmetatable(adapter)
if adapter.setup then
adapter.setup(config)
elseif meta and meta.__call then
adapter(config)
else
error("Adapter " .. name .. " does not support setup")
end
end
adapters[#adapters + 1] = adapter
end
end
opts.adapters = adapters
end
require("neotest").setup(opts)
end,
-- stylua: ignore
keys = {
{ "<leader>tT", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>tt", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
{ "<leader>ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
{ "<leader>to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
{ "<leader>tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
{ "<leader>tS", function() require("neotest").run.stop() end, desc = "Stop" },
},
},
{
"barreiroleo/ltex_extra.nvim",
ft = { "markdown", "tex", "typst", "typ" },