neovim/lua/plugins/trouble.lua
2025-03-11 18:48:02 +01:00

45 lines
1.1 KiB
Lua

return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
event = "CmdlineEnter",
---@type trouble.Config
opts = {
---@type trouble.Window.opts
win = { type = "split", position = "right" },
auto_close = true,
---@type table<string, trouble.Mode>
modes = {
-- sources define their own modes, which you can use directly,
-- or override like in the example below
lsp_references = {
-- some modes are configurable, see the source code for more details
params = {
include_declaration = true,
},
},
},
icons = {
indent = {
last = "╰╴", -- rounded
},
},
},
keys = {
{
"<leader>xl",
function()
require("trouble").toggle({ mode = "loclist" })
end,
desc = "Location List (Trouble)",
},
{
"<leader>xq",
function()
require("trouble").toggle({ mode = "quickfix" })
end,
desc = "Quick fixes (Trouble)",
},
{ "<leader>xr", "<cmd>Trouble lsp_references toggle<cr>", desc = "" },
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
},
}