illuminate.lua 1.9 KB

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