summaryrefslogtreecommitdiff
path: root/lua/spacegray/util.lua
diff options
context:
space:
mode:
authorChristian Chiarulli <[email protected]>2021-07-13 21:13:55 -0400
committerGitHub <[email protected]>2021-07-13 21:13:55 -0400
commita097fa4c04e6db34bb409e0dea302c20629da8ec (patch)
treefb1c5bdd14cac82a363ea6c25b03a475050305f2 /lua/spacegray/util.lua
parent04f9f53914a7dd999117ed73c5fa0ab3b0dc95e4 (diff)
LunarVim 0.4.8 (#919)0.4.8
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