generated from LazyVim/starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
indent-blankline.lua
36 lines (33 loc) · 1.2 KB
/
indent-blankline.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local HIGHLIGHTS = {
{ highlight = "RainbowRed", color = "#E06C75" },
{ highlight = "RainbowOrange", color = "#D19A66" },
{ highlight = "RainbowYellow", color = "#E5C07B" },
{ highlight = "RainbowGreen", color = "#98C379" },
{ highlight = "RainbowBlue", color = "#61AFEF" },
{ highlight = "RainbowCyan", color = "#56B6C2" },
{ highlight = "RainbowViolet", color = "#C678DD" },
}
local function get_highlight_names()
local keyset = {}
for i, highlight in pairs(HIGHLIGHTS) do
keyset[i] = highlight.highlight
end
return keyset
end
-- Customize the "ibl" plugin that is already packaged with LazyVim with rainbow colors!
return {
"lukas-reineke/indent-blankline.nvim",
opts = { indent = { highlight = get_highlight_names() } },
config = function(plugin, opts)
local hooks = require("ibl.hooks")
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
for _, highlight in pairs(HIGHLIGHTS) do
vim.api.nvim_set_hl(0, highlight.highlight, { fg = highlight.color })
end
end)
-- `plugin.main` is "ibl"
require(plugin.main).setup(opts)
end,
}