cleanup config

This commit is contained in:
Michael Chris Lopez
2021-08-31 10:32:00 +08:00
parent 6865eead2e
commit 48c62bf94e

View File

@@ -1,18 +1,16 @@
local lush = require "lush"
local c = require "zenbones.colors"
local config = {
sand_li = 0,
diff_li = 0,
}
local normal_bg = c.sand
local diff_bg_li = 0
local lightness = vim.g.zenbones_lightness
if lightness == "bright" then
config.sand_li = -4
config.diff_li = -4
normal_bg = normal_bg.abs_da(-4)
diff_li = -4
elseif lightness == "dim" then
config.sand_li = 4
config.diff_li = 4
normal_bg = normal_bg.abs_da(4)
diff_li = 4
elseif lightness ~= nil then
local error_msg = "Unknown zenbones_lightness value: " .. vim.inspect(lightness)
vim.api.nvim_echo({ { error_msg, "WarningMsg" } }, true, {})
@@ -35,7 +33,7 @@ return lush(function()
-- styling for that group (meaning they mostly get styled as Normal)
-- or leave them commented to apply vims default colouring or linking.
Normal { bg = c.sand.abs_da(config.sand_li), fg = c.stone }, -- normal text
Normal { bg = normal_bg, fg = c.stone }, -- normal text
Underlined { gui = "underline" }, -- (preferred) text that stands out, HTML links
Bold { gui = "bold" },
@@ -58,10 +56,10 @@ return lush(function()
CursorColumn { CursorLine }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
ColorColumn { bg = c.wood.de(38).li(80) }, -- used for the columns set with 'colorcolumn'
DiffAdd { bg = c.leaf.de(77).li(82).abs_da(config.diff_li) }, -- diff mode: Added line |diff.txt|
DiffChange { bg = c.water.de(22).li(76).abs_da(config.diff_li) }, -- diff mode: Changed line |diff.txt|
DiffDelete { bg = c.rose.de(32).li(74).abs_da(config.diff_li) }, -- diff mode: Deleted line |diff.txt|
DiffText { bg = c.water.de(24).li(64).abs_da(config.diff_li), fg = c.stone }, -- diff mode: Changed text within a changed line |diff.txt|
DiffAdd { bg = c.leaf.de(77).li(82).abs_da(diff_li) }, -- diff mode: Added line |diff.txt|
DiffChange { bg = c.water.de(22).li(76).abs_da(diff_li) }, -- diff mode: Changed line |diff.txt|
DiffDelete { bg = c.rose.de(32).li(74).abs_da(diff_li) }, -- diff mode: Deleted line |diff.txt|
DiffText { bg = c.water.de(24).li(64).abs_da(diff_li), fg = c.stone }, -- diff mode: Changed text within a changed line |diff.txt|
LineNr { fg = Normal.bg.da(36) }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
SignColumn { LineNr }, -- column where |signs| are displayed