summaryrefslogtreecommitdiff
path: root/lua/no-clown-fiesta/util.lua
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-01-10 21:21:00 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-01-10 21:21:00 +0100
commitf7e4be5291637caf41d9358a848e249a72b24db0 (patch)
tree2b5e24b7dd020e270f8f25c56a97538af805833c /lua/no-clown-fiesta/util.lua
Initial commit
Diffstat (limited to 'lua/no-clown-fiesta/util.lua')
-rw-r--r--lua/no-clown-fiesta/util.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/lua/no-clown-fiesta/util.lua b/lua/no-clown-fiesta/util.lua
new file mode 100644
index 0000000..dbac18a
--- /dev/null
+++ b/lua/no-clown-fiesta/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