summaryrefslogtreecommitdiff
path: root/lua/spacegray/util.lua
diff options
context:
space:
mode:
authorchristianchiarulli <[email protected]>2021-07-12 12:51:49 -0400
committerchristianchiarulli <[email protected]>2021-07-12 12:51:49 -0400
commite780972b3061bb2bdd49639870aa7a1b7727cba4 (patch)
treee0e95943f611f64a8fce4802d0db2bb423cb253b /lua/spacegray/util.lua
parent83602dc56304d9b626860c4447d65430473207d0 (diff)
spacegray now in lua
Diffstat (limited to 'lua/spacegray/util.lua')
-rw-r--r--lua/spacegray/util.lua22
1 files changed, 22 insertions, 0 deletions
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