From e780972b3061bb2bdd49639870aa7a1b7727cba4 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 12 Jul 2021 12:51:49 -0400 Subject: spacegray now in lua --- lua/spacegray/util.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lua/spacegray/util.lua (limited to 'lua/spacegray/util.lua') diff --git a/lua/spacegray/util.lua b/lua/spacegray/util.lua new file mode 100644 index 00000000..1cc5a009 --- /dev/null +++ b/lua/spacegray/util.lua @@ -0,0 +1,22 @@ +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 \ No newline at end of file -- cgit v1.2.3