diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/gruvbox/base.lua | 14 | ||||
| -rw-r--r-- | lua/gruvbox/init.lua | 9 | ||||
| -rw-r--r-- | lua/gruvbox/utils.lua | 7 |
3 files changed, 15 insertions, 15 deletions
diff --git a/lua/gruvbox/base.lua b/lua/gruvbox/base.lua index 1f973e7..38653f1 100644 --- a/lua/gruvbox/base.lua +++ b/lua/gruvbox/base.lua @@ -1,12 +1,6 @@ local colors = require("gruvbox.colors") local utils = require("gruvbox.utils") --- reset colors -vim.cmd("hi clear") -if vim.fn.exists("syntax_on") then - vim.cmd("syntax reset") -end - -- gruvbox settings handler local settings = { contrast_dark = "medium", @@ -56,11 +50,7 @@ local aqua = colors.bright_aqua local orange = colors.bright_orange local gray = colors.gray -local bg = vim.opt.background:get() -if bg == nil then - bg = "dark" - vim.o.background = bg -end +local bg = vim.o.background -- swap colors if light mode if bg == "light" then @@ -149,8 +139,6 @@ vim.g.terminal_color_14 = aqua vim.g.terminal_color_7 = fg4 vim.g.terminal_color_15 = fg1 -vim.g.colors_name = "gruvbox" - local base_group = { -- Base groups GruvboxFg0 = { fg = fg0 }, diff --git a/lua/gruvbox/init.lua b/lua/gruvbox/init.lua index cb55b9c..dd324fa 100644 --- a/lua/gruvbox/init.lua +++ b/lua/gruvbox/init.lua @@ -13,7 +13,14 @@ M.load = function() return end - vim.opt.termguicolors = true + -- reset colors + vim.cmd("hi clear") + if vim.fn.exists("syntax_on") then + vim.cmd("syntax reset") + end + + vim.g.colors_name = "gruvbox" + vim.o.termguicolors = true utils.add_highlights(spec) end diff --git a/lua/gruvbox/utils.lua b/lua/gruvbox/utils.lua index 01aeffb..1c1a17b 100644 --- a/lua/gruvbox/utils.lua +++ b/lua/gruvbox/utils.lua @@ -30,7 +30,12 @@ end M.add_highlights = function(hls) for group, settings in pairs(hls) do - hl(0, group, settings) + -- https://github.com/akinsho/bufferline.nvim/issues/386#issuecomment-1103849289 + if group == "Normal" then + vim.cmd(string.format("hi! Normal guifg=%s guibg=%s", settings.fg, settings.bg)) + else + hl(0, group, settings) + end end end |
