diff --git a/after/plugin/trouble.lua b/after/plugin/trouble.lua new file mode 100644 index 0000000..c7b432b --- /dev/null +++ b/after/plugin/trouble.lua @@ -0,0 +1,64 @@ +local ok, trouble = pcall(require,'trouble') + +if not ok then + return +end + +trouble.setup({ + mode = "document_diagnostics", + auto_open = true, + auto_close = true, + + fold_open = "", + fold_close = "", + + signs = { + error = "", + warning = "", + hint = "", + information = "", + other = "", + } +}) + +local map = vim.keymap.set + +map('n', + 'xx', + function() + trouble.toggle() + end, + {desc = "Toggle trouble"}) +map('n', + 'xw', + function() + trouble.toggle('workspace_diagnostics') + end, + {desc = "Toggle trouble (workspace)"}) +map('n', + 'xd', + function() + trouble.toggle('document_diagnostics') + end, + {desc = "Toggle trouble (document)"}) +map('n', + 'xq', + function() + trouble.toggle('quickfix') + end, + {desc = "Toggle trouble (quickfix)"}) +map('n', + 'xl', + function() + trouble.toggle('loclist') + end, + {desc = "Toggle trouble (loclist)"}) +map('n', + 'xt', + function() + trouble.toggle('todo') + end, + {desc = "Toggle trouble (todo)"}) + +local wk = require("which-key") +wk.register({ x = {name = "Trouble"}},{prefix = ""})