feat(nvim): add trouble nvim

nixos
Moritz Böhme 2023-04-09 19:33:31 +02:00
parent 929773f3e8
commit bc12d257f1
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
1 changed files with 38 additions and 0 deletions

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",
},
},
})