---@module 'trouble' return { "folke/trouble.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, cmd = { "Trouble" }, keys = { { "fD", "Trouble diagnostics open", desc = "Find diagnostics (Trouble)", }, { "fd", "Trouble diagnostics open filter.buf=0", desc = "Find buffer diagnostics (Trouble)", }, { "ll", "Trouble symbols open", desc = "Symbols (Trouble)", }, { "li", "Trouble lsp open", desc = "LSP info of node (Trouble)", }, { "fq", "Trouble qflist open", desc = "Quickfix List (Trouble)", }, }, opts = function() ---@type trouble.Window.opts local win_opts = { -- size = { width = 30, height = 0.5 }, minimal = true, border = "rounded", position = "bottom", } ---@type trouble.Config return { focus = true, ---@type trouble.Window.opts preview = { type = "split", relative = "win", position = "top", }, ---@type table keys = { [""] = "jump_close", [""] = "jump", ["<2-leftmouse>"] = "jump", [""] = "jump_split_close", [""] = "jump_vsplit_close", ["v"] = "jump_split_close", ["s"] = "jump_vsplit_close", [""] = "cancel", -- hack to fool myself into thinking I move to the avobe window ["a"] = function(view, ctx) -- TODO: this is not possible until this issue is solved -- https://github.com/neovim/neovim/issues/31206 local trouble = require("trouble") view:action("jump_only") vim.lsp.buf.code_action() trouble.focus(view, ctx) end, }, win = win_opts, ---@type table modes = { symbols = { focus = true, win = win_opts }, lsp_references = { focus = true, win = win_opts }, lsp = { focus = true, win = win_opts }, } } end }