-- Joinked word-by-word from https://www.lazyvim.org/plugins/editor#troublenvim return { -- Better diagnostics 'folke/trouble.nvim', cmd = { 'Trouble' }, opts = { modes = { lsp = { win = { position = 'right' }, }, }, }, keys = { { 'xx', 'Trouble diagnostics toggle', desc = 'Diagnostics (Trouble)' }, { 'xX', 'Trouble diagnostics toggle filter.buf=0', desc = 'Buffer Diagnostics (Trouble)' }, { 'cs', 'Trouble symbols toggle', desc = 'Symbols (Trouble)' }, { 'cS', 'Trouble lsp toggle', desc = 'LSP references/definitions/... (Trouble)' }, { 'xL', 'Trouble loclist toggle', desc = 'Location List (Trouble)' }, { 'xQ', 'Trouble qflist toggle', desc = 'Quickfix List (Trouble)' }, { '[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, desc = 'Next Trouble/Quickfix Item', }, }, }