LunarVim.LunarVim/lua/spacegray/util.lua

26 lines
535 B
Lua
Raw Normal View History

2021-07-12 12:51:49 -04:00
local M = {}
local function highlight(group, properties)
2021-07-15 05:51:16 +04:30
local bg = properties.bg == nil and "" or "guibg=" .. properties.bg
local fg = properties.fg == nil and "" or "guifg=" .. properties.fg
local style = properties.style == nil and "" or "gui=" .. properties.style
2021-07-12 12:51:49 -04:00
2021-07-15 05:51:16 +04:30
local cmd = table.concat({
"highlight",
group,
bg,
fg,
style,
}, " ")
2021-07-12 12:51:49 -04:00
2021-07-15 05:51:16 +04:30
vim.api.nvim_command(cmd)
2021-07-12 12:51:49 -04:00
end
function M.initialise(skeleton)
2021-07-15 05:51:16 +04:30
for group, properties in pairs(skeleton) do
highlight(group, properties)
end
2021-07-12 12:51:49 -04:00
end
2021-07-15 05:51:16 +04:30
return M