trouble.lua 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. return {
  2. "folke/trouble.nvim",
  3. dependencies = { "nvim-tree/nvim-web-devicons" },
  4. opts = {
  5. position = "bottom", -- position of the list can be: bottom, top, left, right
  6. height = 10, -- height of the trouble list when position is top or bottom
  7. width = 50, -- width of the list when position is left or right
  8. icons = true, -- use devicons for filenames
  9. mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
  10. severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT
  11. fold_open = "", -- icon used for open folds
  12. fold_closed = "", -- icon used for closed folds
  13. group = true, -- group results by file
  14. padding = true, -- add an extra new line on top of the list
  15. cycle_results = true, -- cycle item list when reaching beginning or end of list
  16. action_keys = { -- key mappings for actions in the trouble list
  17. -- map to {} to remove a mapping, for example:
  18. -- close = {},
  19. close = "q", -- close the list
  20. cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
  21. refresh = "r", -- manually refresh
  22. jump = { "<cr>", "<tab>", "<2-leftmouse>" }, -- jump to the diagnostic or open / close folds
  23. open_split = { "<c-x>" }, -- open buffer in new split
  24. open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
  25. open_tab = { "<c-t>" }, -- open buffer in new tab
  26. jump_close = { "o" }, -- jump to the diagnostic and close the list
  27. toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
  28. switch_severity = "s", -- switch "diagnostics" severity filter level to HINT / INFO / WARN / ERROR
  29. toggle_preview = "P", -- toggle auto_preview
  30. hover = "K", -- opens a small popup with the full multiline message
  31. preview = "p", -- preview the diagnostic location
  32. open_code_href = "c", -- if present, open a URI with more information about the diagnostic error
  33. close_folds = { "zM", "zm" }, -- close all folds
  34. open_folds = { "zR", "zr" }, -- open all folds
  35. toggle_fold = { "zA", "za" }, -- toggle fold of current file
  36. previous = "k", -- previous item
  37. next = "j", -- next item
  38. help = "?" -- help menu
  39. },
  40. multiline = true, -- render multi-line messages
  41. indent_lines = true, -- add an indent guide below the fold icons
  42. win_config = { border = "single" }, -- window configuration for floating windows. See |nvim_open_win()|.
  43. auto_open = false, -- automatically open the list when you have diagnostics
  44. auto_close = false, -- automatically close the list when you have no diagnostics
  45. auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
  46. auto_fold = false, -- automatically fold a file trouble list at creation
  47. auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
  48. include_declaration = { "lsp_references", "lsp_implementations", "lsp_definitions" }, -- for the given modes, include the declaration of the current symbol in the results
  49. signs = {
  50. -- icons / text used for a diagnostic
  51. error = "",
  52. warning = "",
  53. hint = "",
  54. information = "",
  55. other = "",
  56. },
  57. use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
  58. }
  59. }