Skip to content

Commit 6149e08

Browse files
committed
Add trouble plugin
1 parent 70cac81 commit 6149e08

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

lua/custom/plugins/trouble.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
return {
2+
'folke/trouble.nvim',
3+
dependencies = { 'nvim-tree/nvim-web-devicons' },
4+
opts = {},
5+
config = function()
6+
local function mapLeader(key, troubleFunc, description)
7+
vim.keymap.set('n', '<leader>' .. key, function()
8+
require('trouble').toggle(troubleFunc)
9+
end, { desc = description })
10+
end
11+
12+
-- Utilizzo della funzione mapLeader per definire i mapping
13+
mapLeader('xx', nil, 'Toggle Trouble')
14+
mapLeader('xw', 'workspace_diagnostics', 'Toggle Workspace Diagnostics')
15+
mapLeader('xd', 'document_diagnostics', 'Toggle Document Diagnostics')
16+
mapLeader('xq', 'quickfix', 'Toggle Quickfix')
17+
mapLeader('xl', 'loclist', 'Toggle Location List')
18+
19+
vim.keymap.set('n', 'gR', function()
20+
require('trouble').toggle 'lsp_references'
21+
end)
22+
end,
23+
}

0 commit comments

Comments
 (0)