vim: improve color declarations in lualine config
This commit is contained in:
parent
0945175fe5
commit
d8ba015ccd
1 changed files with 59 additions and 60 deletions
|
@ -1,31 +1,30 @@
|
||||||
local colors = {}
|
local gui = vim.opt.termguicolors:get()
|
||||||
if vim.opt.termguicolors:get() then
|
|
||||||
colors = {
|
local function color(tbl)
|
||||||
base03 = '#002b36', yellow = '#b58900',
|
if gui then return tbl.gui end
|
||||||
base02 = '#073642', orange = '#cb4b16',
|
return tbl.index
|
||||||
base01 = '#586e75', red = '#dc322f',
|
|
||||||
base00 = '#657b83', magenta = '#d33682',
|
|
||||||
base0 = '#839496', violet = '#6c71c4',
|
|
||||||
base1 = '#93a1a1', blue = '#268bd2',
|
|
||||||
base2 = '#eee8d5', cyan = '#2aa198',
|
|
||||||
base3 = '#fdf6e3', green = '#859900',
|
|
||||||
}
|
|
||||||
else
|
|
||||||
colors = {
|
|
||||||
base03 = 8, yellow = 3,
|
|
||||||
base02 = 0, orange = 9,
|
|
||||||
base01 = 10, red = 1,
|
|
||||||
base00 = 11, magenta = 5,
|
|
||||||
base0 = 12, violet = 13,
|
|
||||||
base1 = 14, blue = 4,
|
|
||||||
base2 = 7, cyan = 6,
|
|
||||||
base3 = 15, green = 2,
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
base03 = color { index = 8, gui = '#002b36' }
|
||||||
|
base02 = color { index = 0, gui = '#073642' }
|
||||||
|
base01 = color { index = 10, gui = '#586e75' }
|
||||||
|
base00 = color { index = 11, gui = '#657b83' }
|
||||||
|
base0 = color { index = 12, gui = '#839496' }
|
||||||
|
base1 = color { index = 14, gui = '#93a1a1' }
|
||||||
|
base2 = color { index = 7, gui = '#eee8d5' }
|
||||||
|
base3 = color { index = 15, gui = '#fdf6e3' }
|
||||||
|
yellow = color { index = 3, gui = '#b58900' }
|
||||||
|
orange = color { index = 9, gui = '#cb4b16' }
|
||||||
|
red = color { index = 1, gui = '#dc322f' }
|
||||||
|
magenta = color { index = 5, gui = '#d33682' }
|
||||||
|
violet = color { index = 13, gui = '#6c71c4' }
|
||||||
|
blue = color { index = 4, gui = '#268bd2' }
|
||||||
|
cyan = color { index = 6, gui = '#2aa198' }
|
||||||
|
green = color { index = 2, gui = '#859900' }
|
||||||
|
|
||||||
local paste = {
|
local paste = {
|
||||||
function() return 'P' end,
|
function() return 'P' end,
|
||||||
color = { fg = colors.base3, bg = colors.yellow, gui = 'bold' },
|
color = { fg = base3, bg = yellow, gui = 'bold' },
|
||||||
cond = function() return vim.opt.paste:get() end
|
cond = function() return vim.opt.paste:get() end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,50 +42,50 @@ local encoding = function ()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- let padding when using icons leaves too much space
|
-- let padding when using icons leaves too much space
|
||||||
local fileformat = { 'fileformat', padding = { left = 0, right = 1} }
|
local fileformat = { 'fileformat', padding = { left = 0, right = 1}}
|
||||||
|
|
||||||
local progress = '%3l/%L|%-2v' -- line / total |column
|
local progress = '%3l/%L|%-2v' -- line / total |column
|
||||||
|
|
||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
component_separators = { left = '', right = '' },
|
component_separators = { left = '', right = '' },
|
||||||
section_separators = { left = '', right = '' },
|
section_separators = { left = '', right = '' },
|
||||||
theme = {
|
theme = {
|
||||||
normal = {
|
normal = {
|
||||||
a = { fg = colors.base03, bg = colors.blue, gui='bold' },
|
a = { fg = base03, bg = blue, gui='bold' },
|
||||||
b = { fg = colors.base2, bg = colors.base00 },
|
b = { fg = base2, bg = base00 },
|
||||||
c = { fg = colors.base1, bg = colors.base02 },
|
c = { fg = base1, bg = base02 },
|
||||||
},
|
},
|
||||||
insert = { a = { fg = colors.base03, bg = colors.green, gui = 'bold' } },
|
insert = { a = { fg = base03, bg = green, gui = 'bold' } },
|
||||||
visual = { a = { fg = colors.base03, bg = colors.magenta, gui = 'bold' } },
|
visual = { a = { fg = base03, bg = magenta, gui = 'bold' } },
|
||||||
replace = { a = { fg = colors.base03, bg = colors.red, gui = 'bold' } },
|
replace = { a = { fg = base03, bg = red, gui = 'bold' } },
|
||||||
inactive = {
|
inactive = {
|
||||||
a = { fg = colors.base1, bg = colors.base00 },
|
a = { fg = base1, bg = base00 },
|
||||||
b = { fg = colors.base0, bg = colors.base01 },
|
b = { fg = base0, bg = base01 },
|
||||||
c = { fg = colors.base00, bg = colors.base02 },
|
c = { fg = base00, bg = base02 },
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { 'mode', paste },
|
lualine_a = { 'mode', paste },
|
||||||
lualine_b = { 'diagnostics', 'branch' },
|
lualine_b = { 'diagnostics', 'branch' },
|
||||||
lualine_c = { relative_path },
|
lualine_c = { relative_path },
|
||||||
lualine_x = { 'filetype' },
|
lualine_x = { 'filetype' },
|
||||||
lualine_y = { encoding, fileformat },
|
lualine_y = { encoding, fileformat },
|
||||||
lualine_z = { progress },
|
lualine_z = { progress },
|
||||||
},
|
},
|
||||||
|
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = { 'diagnostics', 'branch' },
|
lualine_b = { 'diagnostics', 'branch' },
|
||||||
lualine_c = { relative_path },
|
lualine_c = { relative_path },
|
||||||
lualine_x = { { 'filetype', colored = false } },
|
lualine_x = { { 'filetype', colored = false } },
|
||||||
lualine_y = { encoding, fileformat },
|
lualine_y = { encoding, fileformat },
|
||||||
lualine_z = { progress },
|
lualine_z = { progress },
|
||||||
},
|
},
|
||||||
|
|
||||||
extensions = { 'fugitive', 'quickfix' }
|
extensions = { 'fugitive', 'quickfix' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue