summaryrefslogtreecommitdiff
path: root/lua/lvim/core/illuminate.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-10-17 17:29:15 +0200
committerkylo252 <[email protected]>2022-10-17 17:29:15 +0200
commit4ef07315003f723bb8e97d5a91b2bde3773ec1b8 (patch)
treee9889a492f76e3f9573228343aaba647dfd48136 /lua/lvim/core/illuminate.lua
parente4a5fe97abe500bbbe78fb137d57a59f558da05a (diff)
parent6f6cbc394d2a7e64964b6067a2f42d2e6a07824e (diff)
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/core/illuminate.lua')
-rw-r--r--lua/lvim/core/illuminate.lua68
1 files changed, 68 insertions, 0 deletions
diff --git a/lua/lvim/core/illuminate.lua b/lua/lvim/core/illuminate.lua
new file mode 100644
index 00000000..a3ca6711
--- /dev/null
+++ b/lua/lvim/core/illuminate.lua
@@ -0,0 +1,68 @@
+local M = {}
+
+M.config = function()
+ lvim.builtin.illuminate = {
+ active = true,
+ on_config_done = nil,
+ options = {
+ -- providers: provider used to get references in the buffer, ordered by priority
+ providers = {
+ "lsp",
+ "treesitter",
+ "regex",
+ },
+ -- delay: delay in milliseconds
+ delay = 120,
+ -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
+ filetypes_denylist = {
+ "dirvish",
+ "fugitive",
+ "alpha",
+ "NvimTree",
+ "packer",
+ "neogitstatus",
+ "Trouble",
+ "lir",
+ "Outline",
+ "spectre_panel",
+ "toggleterm",
+ "DressingSelect",
+ "TelescopePrompt",
+ },
+ -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
+ filetypes_allowlist = {},
+ -- modes_denylist: modes to not illuminate, this overrides modes_allowlist
+ modes_denylist = {},
+ -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
+ modes_allowlist = {},
+ -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
+ -- Only applies to the 'regex' provider
+ -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+ providers_regex_syntax_denylist = {},
+ -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
+ -- Only applies to the 'regex' provider
+ -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+ providers_regex_syntax_allowlist = {},
+ -- under_cursor: whether or not to illuminate under the cursor
+ under_cursor = true,
+ },
+ }
+end
+
+M.setup = function()
+ local status_ok, illuminate = pcall(reload, "illuminate")
+ if not status_ok then
+ return
+ end
+
+ local config_ok, _ = pcall(illuminate.configure, lvim.builtin.illuminate.options)
+ if not config_ok then
+ return
+ end
+
+ if lvim.builtin.illuminate.on_config_done then
+ lvim.builtin.illuminate.on_config_done()
+ end
+end
+
+return M