LunarVim/lua/spacegray/util.lua

22 lines
542 B
Lua
Raw Normal View History

2021-07-12 18:51:49 +02:00
local M = {}
local function highlight(group, properties)
2021-08-01 00:36:51 +02:00
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 18:51:49 +02:00
2021-08-01 00:36:51 +02:00
local cmd = table.concat({
"highlight", group, bg, fg, style
}, " ")
2021-07-12 18:51:49 +02:00
2021-08-01 00:36:51 +02:00
vim.api.nvim_command(cmd)
2021-07-12 18:51:49 +02:00
end
2021-08-01 00:36:51 +02:00
2021-07-12 18:51:49 +02:00
function M.initialise(skeleton)
2021-08-01 00:36:51 +02:00
for group, properties in pairs(skeleton) do
highlight(group, properties)
end
2021-07-12 18:51:49 +02:00
end
2021-08-01 00:36:51 +02:00
return M