summaryrefslogtreecommitdiff
path: root/lua/lvim/core/illuminate.lua
diff options
context:
space:
mode:
authorAbouzar Parvan <[email protected]>2022-09-20 14:11:58 +0430
committerGitHub <[email protected]>2022-09-20 14:11:58 +0430
commit518b1d4167162a54a6e76784038d30191613b76d (patch)
tree6007451a5e1f77db9ee116ee1a262c8f0639115d /lua/lvim/core/illuminate.lua
parent03ec31253fc868b3ab5a8217640ec04248ae0046 (diff)
Fix: make sure latest plugins are customizable (#3044)
* fix: make navim-navic configurable * fix: make sure vim-illuminate is configurable * fix: make sure theme is configurable * fix(ci): don't verify uninstalled plugins * refactor(lsp): add setup_document_symbols util * revert: keep onedarker on freeze branch * refactor(lsp): avoid duplicate hl autocmds Co-authored-by: kylo252 <[email protected]>
Diffstat (limited to 'lua/lvim/core/illuminate.lua')
-rw-r--r--lua/lvim/core/illuminate.lua98
1 files changed, 55 insertions, 43 deletions
diff --git a/lua/lvim/core/illuminate.lua b/lua/lvim/core/illuminate.lua
index e29b091a..e0c8c775 100644
--- a/lua/lvim/core/illuminate.lua
+++ b/lua/lvim/core/illuminate.lua
@@ -1,53 +1,65 @@
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 overriden by filetypes_denylist
+ filetypes_allowlist = {},
+ -- modes_denylist: modes to not illuminate, this overrides modes_allowlist
+ modes_denylist = {},
+ -- modes_allowlist: modes to illuminate, this is overriden 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 overriden 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(require, "illuminate")
if not status_ok then
return
end
- -- default configuration
- illuminate.configure {
- -- 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 overriden by filetypes_denylist
- filetypes_allowlist = {},
- -- modes_denylist: modes to not illuminate, this overrides modes_allowlist
- modes_denylist = {},
- -- modes_allowlist: modes to illuminate, this is overriden 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 overriden 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,
- }
+
+ illuminate.configure(lvim.builtin.illuminate.options)
+
+ if lvim.builtin.illuminate.on_config_done then
+ lvim.builtin.illuminate.on_config_done()
+ end
end
return M