From c41627ea1d440f68d79d0d9ecd87574814ce1fae Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 20 Sep 2021 20:50:03 +0200 Subject: Update bg once again, cleaner dark --- .config/nvim/lua/dark/util.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .config/nvim/lua/dark/util.lua (limited to '.config/nvim/lua/dark/util.lua') diff --git a/.config/nvim/lua/dark/util.lua b/.config/nvim/lua/dark/util.lua new file mode 100644 index 0000000..dbac18a --- /dev/null +++ b/.config/nvim/lua/dark/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 -- cgit v1.2.3-70-g09d2