summaryrefslogtreecommitdiff
path: root/lua/lvim/builtin/illuminate.lua
diff options
context:
space:
mode:
authorLostNeophyte <[email protected]>2023-02-18 08:55:05 +0100
committerLostNeophyte <[email protected]>2023-02-18 08:55:05 +0100
commit8f70ecd882cf44567ddbffb469373501492938f9 (patch)
tree1498fd1de08c1aec46fa628701e1b5e9a47c4e3b /lua/lvim/builtin/illuminate.lua
parent3144585515000a1c3064c6129ded74f662598de1 (diff)
refactor(builtins): move builtins to lvim/builtinrefactor/builtins
Diffstat (limited to 'lua/lvim/builtin/illuminate.lua')
-rw-r--r--lua/lvim/builtin/illuminate.lua69
1 files changed, 69 insertions, 0 deletions
diff --git a/lua/lvim/builtin/illuminate.lua b/lua/lvim/builtin/illuminate.lua
new file mode 100644
index 00000000..75afa362
--- /dev/null
+++ b/lua/lvim/builtin/illuminate.lua
@@ -0,0 +1,69 @@
+local M = {}
+
+M.config = function()
+ lvim.builtin.illuminate = {
+ active = true,
+ options = {
+ -- providers: provider used to get references in the buffer, ordered by priority
+ providers = {
+ "lsp",
+ "treesitter",
+ "regex",
+ },
+ -- delay: delay in milliseconds
+ delay = 120,
+ -- filetype_overrides: filetype specific overrides.
+ -- The keys are strings to represent the filetype while the values are tables that
+ -- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
+ filetype_overrides = {},
+ -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
+ filetypes_denylist = {
+ "dirvish",
+ "fugitive",
+ "alpha",
+ "NvimTree",
+ "lazy",
+ "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
+
+ return illuminate
+end
+
+return M