illuminate.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. local M = {}
  2. M.config = function()
  3. lvim.builtin.illuminate = {
  4. active = true,
  5. on_config_done = nil,
  6. options = {
  7. -- providers: provider used to get references in the buffer, ordered by priority
  8. providers = {
  9. "lsp",
  10. "treesitter",
  11. "regex",
  12. },
  13. -- delay: delay in milliseconds
  14. delay = 120,
  15. -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
  16. filetypes_denylist = {
  17. "dirvish",
  18. "fugitive",
  19. "alpha",
  20. "NvimTree",
  21. "packer",
  22. "neogitstatus",
  23. "Trouble",
  24. "lir",
  25. "Outline",
  26. "spectre_panel",
  27. "toggleterm",
  28. "DressingSelect",
  29. "TelescopePrompt",
  30. },
  31. -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
  32. filetypes_allowlist = {},
  33. -- modes_denylist: modes to not illuminate, this overrides modes_allowlist
  34. modes_denylist = {},
  35. -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
  36. modes_allowlist = {},
  37. -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
  38. -- Only applies to the 'regex' provider
  39. -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
  40. providers_regex_syntax_denylist = {},
  41. -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
  42. -- Only applies to the 'regex' provider
  43. -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
  44. providers_regex_syntax_allowlist = {},
  45. -- under_cursor: whether or not to illuminate under the cursor
  46. under_cursor = true,
  47. },
  48. }
  49. end
  50. M.setup = function()
  51. local status_ok, illuminate = pcall(reload, "illuminate")
  52. if not status_ok then
  53. return
  54. end
  55. illuminate.configure(lvim.builtin.illuminate.options)
  56. if lvim.builtin.illuminate.on_config_done then
  57. lvim.builtin.illuminate.on_config_done()
  58. end
  59. end
  60. return M