From b24b53c8003f152369b09a5afcaf51305db31459 Mon Sep 17 00:00:00 2001 From: Michael Chris Lopez Date: Tue, 31 Aug 2021 12:23:27 +0800 Subject: [PATCH] refactor config using lush.merge --- colors/zenbones.vim | 1 - lua/zenbones/init.lua | 37 +++++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/colors/zenbones.vim b/colors/zenbones.vim index e0407a9..1240430 100644 --- a/colors/zenbones.vim +++ b/colors/zenbones.vim @@ -166,7 +166,6 @@ highlight CursorLineNr guifg=#2C363C guibg=NONE guisp=NONE gui=bold highlight MoreMsg guifg=#617437 guibg=NONE guisp=NONE gui=bold highlight NormalFloat guifg=NONE guibg=#E1DCD9 guisp=NONE gui=NONE highlight FloatBorder guifg=#786D68 guibg=NONE guisp=NONE gui=NONE -highlight! link NormalNC Normal highlight Pmenu guifg=NONE guibg=#DAD3CF guisp=NONE gui=NONE highlight PmenuSel guifg=NONE guibg=#C4B6AF guisp=NONE gui=NONE highlight PmenuSbar guifg=NONE guibg=#B2A39B guisp=NONE gui=NONE diff --git a/lua/zenbones/init.lua b/lua/zenbones/init.lua index 2b37e6e..dddec76 100644 --- a/lua/zenbones/init.lua +++ b/lua/zenbones/init.lua @@ -16,11 +16,8 @@ elseif lightness ~= nil then vim.api.nvim_echo({ { error_msg, "WarningMsg" } }, true, {}) end -local solid_vert_split = vim.g.zenbones_solid_vert_split -local dim_noncurrent_window = vim.g.zenbones_dim_noncurrent_window - -- stylua: ignore start -return lush(function() +local theme = lush(function() return { -- The following are all the Neovim default highlight groups from the docs -- as of 0.5.0-nightly-446, to aid your theme creation. Your themes should @@ -74,7 +71,6 @@ return lush(function() MoreMsg { fg = c.leaf, gui = "bold" }, -- |more-prompt| NormalFloat { bg = Normal.bg.da(6) }, -- Normal text in floating windows. FloatBorder { fg = Normal.bg.da(50) }, -- Normal text in floating windows. - NormalNC (dim_noncurrent_window and { Normal, bg = Normal.bg.abs_da(2) } or { Normal }), -- normal text in non-current windows Pmenu { bg = Normal.bg.da(10) }, -- Popup menu: normal item. PmenuSel { bg = Normal.bg.da(20) }, -- Popup menu: selected item. @@ -97,7 +93,7 @@ return lush(function() TabLine { StatusLine, gui = "italic" }, -- tab pages line, not active tab page label TabLineFill { StatusLineNC }, -- tab pages line, where there are no labels TabLineSel { gui = "bold" }, -- tab pages line, active tab page label - VertSplit (solid_vert_split and { bg = StatusLineNC.bg, fg = LineNr.fg } or { fg = PmenuThumb.bg }), -- the column separating vertically split windows + VertSplit { fg = PmenuThumb.bg }, -- the column separating vertically split windows Visual { bg = c.stone.li(84) }, -- Visual mode selection -- VisualNOS { }, -- Visual mode selection when vim is "Not Owning the Selection". @@ -310,4 +306,33 @@ return lush(function() } end) -- stylua: ignore end + +local specs = { + theme, +} + +if vim.g.zenbones_dim_noncurrent_window then + table.insert( + specs, + lush(function() + return { + NormalNC { theme.Normal, bg = theme.Normal.bg.abs_da(2) }, -- normal text in non-current windows + } + end) + ) +end + +if vim.g.zenbones_solid_vert_split then + table.insert( + specs, + lush(function() + return { + VertSplit { bg = theme.StatusLineNC.bg, fg = theme.LineNr.fg }, -- the column separating vertically split windows + } + end) + ) +end + +return lush.merge(specs) + -- vi:nowrap