feat(nvim): add trouble nvim
parent
929773f3e8
commit
bc12d257f1
|
@ -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",
|
||||
},
|
||||
},
|
||||
})
|
Loading…
Reference in New Issue