local status_ok, trouble = pcall(require, "trouble") if not status_ok then return end trouble.setup({ position = "bottom", height = 15, icons = true, mode = "workspace_diagnostics", severity = nil, fold_open = "", fold_closed = "", action_keys = { close = "q", refresh = "r", jump = { "", "" }, open_split = "x", open_vsplit = "v", preview = "p", close_folds = "zm", open_folds = "zr", toggle_fold = "za", previous = "k", next = "j", }, auto_preview = true, use_diagnostic_signs = true, }) local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } map("n", "xx", "TroubleToggle workspace_diagnostics", opts) map("n", "xd", "TroubleToggle document_diagnostics", opts) map("n", "xq", "TroubleToggle quickfix", opts) map("n", "xl", "TroubleToggle loclist", opts) map("n", "gr", "TroubleToggle lsp_references", opts)