1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
return {
'folke/trouble.nvim',
opts = {},
cmd = 'Trouble',
keys = {
{
"<leader>df",
function()
local trouble = require("trouble")
local opts = {
mode = "diagnostics",
focus = true,
follow = false
}
if trouble.is_open(opts) then
if vim.o.ft == "trouble" then
trouble.close(opts)
else
trouble.focus("diagnostics")
end
else
trouble.open(opts)
end
end,
desc = "Diagnostics (Trouble)",
},
{
"<leader>dF",
function()
local trouble = require("trouble")
local opts = {
mode = "diagnostics",
focus = true,
follow = false,
filter = { buf = 0 }
}
if trouble.is_open(opts) then
if vim.o.ft == "trouble" then
trouble.close(opts)
else
trouble.focus()
end
else
trouble.open(opts)
end
end,
desc = "Buffer Diagnostics (Trouble)",
},
{
"[d",
function()
require("trouble").prev({ mode = "diagnostics", jump = true })
end,
desc = "Previous project wide diagnostic"
},
{
"]d",
function()
require("trouble").next({ mode = "diagnostics", jump = true })
end,
desc = "Next project wide diagnostic"
},
{
"<leader>dl",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>dq",
function()
require("trouble").toggle({
mode = "qflist",
auto_close = true,
auto_preview = false,
focus = true,
follow = false,
})
end,
desc = "Quickfix List (Trouble)",
},
},
}
|