vim: make a proper lualine
theme and support light background
This commit is contained in:
parent
b17f89a14b
commit
b5bebc2db6
2 changed files with 32 additions and 47 deletions
|
@ -10,44 +10,6 @@ local Table = {
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
local colors = require'fs.util'.colors()
|
|
||||||
|
|
||||||
local theme = (function()
|
|
||||||
local active = {
|
|
||||||
a = Table:new { fg = colors.base03, bg = colors.base1 },
|
|
||||||
b = Table:new { fg = colors.base03, bg = colors.base0 },
|
|
||||||
c = Table:new { fg = colors.base1, bg = colors.base02 },
|
|
||||||
}
|
|
||||||
|
|
||||||
local inactive = {
|
|
||||||
a = { fg = colors.base02, bg = colors.base00 },
|
|
||||||
b = { fg = colors.base02, bg = colors.base01 },
|
|
||||||
c = { fg = colors.base01, bg = colors.base03 },
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
normal = {
|
|
||||||
a = active.a:override { bg = colors.blue },
|
|
||||||
b = active.b,
|
|
||||||
c = active.c,
|
|
||||||
},
|
|
||||||
insert = {
|
|
||||||
a = active.a:override { bg = colors.green },
|
|
||||||
},
|
|
||||||
visual = {
|
|
||||||
a = active.a:override { bg = colors.magenta },
|
|
||||||
},
|
|
||||||
replace = {
|
|
||||||
a = active.a:override { bg = colors.red },
|
|
||||||
},
|
|
||||||
inactive = {
|
|
||||||
a = inactive.a,
|
|
||||||
b = inactive.b,
|
|
||||||
c = inactive.c,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end)()
|
|
||||||
|
|
||||||
local MODE_MAP = {
|
local MODE_MAP = {
|
||||||
['n'] = 'Normal ',
|
['n'] = 'Normal ',
|
||||||
['no'] = 'O-Pend ',
|
['no'] = 'O-Pend ',
|
||||||
|
@ -106,6 +68,7 @@ end
|
||||||
local window_is_wide = window_is_at_least(80)
|
local window_is_wide = window_is_at_least(80)
|
||||||
local window_is_medium = window_is_at_least(50)
|
local window_is_medium = window_is_at_least(50)
|
||||||
|
|
||||||
|
local C = require'fs.util'.colors()
|
||||||
local parts = {
|
local parts = {
|
||||||
split = { function() return '%=' end, padding = 0 },
|
split = { function() return '%=' end, padding = 0 },
|
||||||
|
|
||||||
|
@ -116,7 +79,7 @@ local parts = {
|
||||||
|
|
||||||
paste = {
|
paste = {
|
||||||
function() return '' end,
|
function() return '' end,
|
||||||
color = { fg = colors.base03, bg = colors.yellow, gui = 'bold' },
|
color = { fg = C.base03, bg = C.yellow, gui = 'bold' },
|
||||||
cond = function()
|
cond = function()
|
||||||
return vim.opt.paste:get()
|
return vim.opt.paste:get()
|
||||||
end
|
end
|
||||||
|
@ -137,9 +100,9 @@ local parts = {
|
||||||
diff = {
|
diff = {
|
||||||
diff,
|
diff,
|
||||||
diff_color = {
|
diff_color = {
|
||||||
added = { fg = colors.green },
|
added = { fg = C.green },
|
||||||
modified = { fg = colors.yellow },
|
modified = { fg = C.yellow },
|
||||||
removed = { fg = colors.orange },
|
removed = { fg = C.orange },
|
||||||
},
|
},
|
||||||
padding = 0,
|
padding = 0,
|
||||||
cond = window_is_wide,
|
cond = window_is_wide,
|
||||||
|
@ -179,10 +142,6 @@ local parts = {
|
||||||
return chars[math.ceil(#chars * current / total)]
|
return chars[math.ceil(#chars * current / total)]
|
||||||
end,
|
end,
|
||||||
padding = { left = 0, right = 1 },
|
padding = { left = 0, right = 1 },
|
||||||
color = {
|
|
||||||
fg = theme.normal.b.bg,
|
|
||||||
bg = theme.normal.c.bg,
|
|
||||||
},
|
|
||||||
cond = window_is_wide,
|
cond = window_is_wide,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -203,7 +162,7 @@ require('lualine').setup {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
component_separators = { left = '', right = '' },
|
component_separators = { left = '', right = '' },
|
||||||
section_separators = { left = '', right = '' },
|
section_separators = { left = '', right = '' },
|
||||||
theme = theme,
|
theme = 'solarized',
|
||||||
},
|
},
|
||||||
|
|
||||||
sections = sections:override { lualine_a = { parts.mode, parts.paste } },
|
sections = sections:override { lualine_a = { parts.mode, parts.paste } },
|
||||||
|
|
26
config/nvim/lua/lualine/themes/solarized.lua
Normal file
26
config/nvim/lua/lualine/themes/solarized.lua
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
local C = require'fs.util'.colors()
|
||||||
|
|
||||||
|
local a_fg = C.base03
|
||||||
|
|
||||||
|
return {
|
||||||
|
normal = {
|
||||||
|
a = { fg = a_fg, bg = C.blue },
|
||||||
|
b = { fg = C.base03, bg = C.base0 },
|
||||||
|
c = { fg = C.base1, bg = C.base02 },
|
||||||
|
},
|
||||||
|
insert = {
|
||||||
|
a = { fg = a_fg, bg = C.green },
|
||||||
|
},
|
||||||
|
visual = {
|
||||||
|
a = { fg = a_fg, bg = C.magenta },
|
||||||
|
},
|
||||||
|
replace = {
|
||||||
|
a = { fg = a_fg, bg = C.red },
|
||||||
|
},
|
||||||
|
inactive = {
|
||||||
|
a = { fg = C.base02, bg = C.base00 },
|
||||||
|
b = { fg = C.base02, bg = C.base01 },
|
||||||
|
c = { fg = C.base01, bg = C.base03 },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue