diff options
Diffstat (limited to 'lua/onedarker/util.lua')
| -rw-r--r-- | lua/onedarker/util.lua | 25 | 
1 files changed, 25 insertions, 0 deletions
| diff --git a/lua/onedarker/util.lua b/lua/onedarker/util.lua new file mode 100644 index 00000000..dbac18a2 --- /dev/null +++ b/lua/onedarker/util.lua @@ -0,0 +1,25 @@ +local M = {} + +local function highlight(group, properties) +  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 + +  local cmd = table.concat({ +    "highlight", +    group, +    bg, +    fg, +    style, +  }, " ") + +  vim.api.nvim_command(cmd) +end + +function M.initialise(skeleton) +  for group, properties in pairs(skeleton) do +    highlight(group, properties) +  end +end + +return M | 
