diff options
| author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-22 00:08:36 +0200 |
|---|---|---|
| committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-22 00:08:36 +0200 |
| commit | b51f1ae28924a752258e7607fbc3210f9b18eaac (patch) | |
| tree | 8c8c095528990b3f6eb499dbcca15e9720e636d1 /.config/nvim/lua/dark/util.lua | |
| parent | da936b0ed9ac4c171d3c7908e41af1875a82b08b (diff) | |
Updates based on Chris's lunarvim
Diffstat (limited to '.config/nvim/lua/dark/util.lua')
| -rw-r--r-- | .config/nvim/lua/dark/util.lua | 25 |
1 files changed, 25 insertions, 0 deletions
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 |