feat(nvim): add trouble nvim

This commit is contained in:
Moritz Böhme 2023-04-09 19:33:31 +02:00
parent 929773f3e8
commit bc12d257f1
Signed by: moritz
GPG key ID: 970C6E89EB0547A9

View file

@ -0,0 +1,38 @@
require("trouble").setup()
require("which-key").register({
x = { "<cmd>TroubleToggle document_diagnostics<cr>", "Document Diagnostics (Trouble)" },
X = { "<cmd>TroubleToggle workspace_diagnostics<cr>", "Workspace Diagnostics (Troule)" },
l = { "<cmd>TroubleToggle loclist<cr>", "Location List (Trouble)" },
q = { "<cmd>TroubleToggle quickfix<cr>", "Quickfix List (Trouble)" },
t = { "<cmd>TodoTrouble<cr>", "Todo (Trouble)" },
T = { "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", "Todo/Fix/Fixme (Trouble)" },
}, { prefix = "<leader>x" })
require("which-key").register({
t = { "<cmd>TodoTelescope<cr>", "Todo" },
}, { prefix = "<leader>s" })
require("which-key").register({
["["] = {
q = {
function()
if require("trouble").is_open() then
require("trouble").previous({ skip_groups = true, jump = true })
else
vim.cmd.cprev()
end
end,
"Previous trouble/quickfix item",
},
},
["]"] = {
q = {
function()
if require("trouble").is_open() then
require("trouble").next({ skip_groups = true, jump = true })
else
vim.cmd.cnext()
end
end,
"Next trouble/quickfix item",
},
},
})