return { 'trouble.nvim', cmd = { 'Trouble' }, keys = { { 'xQ', 'Trouble qflist toggle', desc = 'quickfix list (trouble)', }, { 'xx', 'Trouble diagnostics toggle', desc = 'diagnostics', }, { 'xX', 'Trouble diagnostics toggle filter.buf=0', desc = 'buffer diagnostics', }, { '[q', function() if require('trouble').is_open() then require('trouble').prev({ skip_groups = true, jump = true }) else local ok, err = pcall(vim.cmd.cprev) if not ok then vim.notify(err, vim.log.levels.ERROR) end end end, desc = 'previous trouble/quickfix item', }, { ']q', function() if require('trouble').is_open() then require('trouble').next({ skip_groups = true, jump = true }) else local ok, err = pcall(vim.cmd.cnext) if not ok then vim.notify(err, vim.log.levels.ERROR) end end end, }, }, after = function() require('trouble').setup({ modes = { lsp = { win = { position = 'right' } } }, }) end, }