nvim: Update lualine diagnostics

master
Ian Mancini 3 years ago
parent f714f732d9
commit 0f66741bde

@ -19,7 +19,9 @@ local colors = {
}
local conditions = {
buffer_not_empty = function() return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 end,
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
end,
hide_in_width = function() return vim.fn.winwidth(0) > 80 end,
check_git_workspace = function()
local filepath = vim.fn.expand('%:p:h')
@ -40,8 +42,18 @@ local config = {
-- We are going to use lualine_c an lualine_x as left and
-- right section. Both are highlighted by c theme . So we
-- are just setting default looks o statusline
normal = {c = {fg = colors.fg, bg = colors.bg}},
inactive = {c = {fg = colors.fg, bg = colors.bg}}
normal = {
c = {
fg = colors.fg,
bg = colors.bg
}
},
inactive = {
c = {
fg = colors.fg,
bg = colors.bg
}
}
}
},
sections = {
@ -77,7 +89,9 @@ end
ins_left {
function() return '' end,
color = {fg = colors.blue}, -- Sets highlighting of component
color = {
fg = colors.blue
}, -- Sets highlighting of component
left_padding = 0 -- We don't need space before this
}
@ -107,8 +121,8 @@ ins_left {
['!'] = colors.red,
t = colors.red
}
vim.api.nvim_command(
'hi! LualineMode guifg=' .. mode_color[vim.fn.mode()] .. " guibg=" ..
vim.api.nvim_command('hi! LualineMode guifg=' ..
mode_color[vim.fn.mode()] .. " guibg=" ..
colors.bg)
return ''
end,
@ -140,17 +154,30 @@ ins_left {
ins_left {
'filename',
condition = conditions.buffer_not_empty,
color = {fg = colors.magenta, gui = 'bold'}
color = {
fg = colors.magenta,
gui = 'bold'
}
}
ins_left {'location'}
ins_left {'progress', color = {fg = colors.fg, gui = 'bold'}}
ins_left {
'progress',
color = {
fg = colors.fg,
gui = 'bold'
}
}
ins_left {
'diagnostics',
sources = {'nvim_lsp'},
symbols = {error = '', warn = '', info = ''},
sources = {'nvim_diagnostic'},
symbols = {
error = '',
warn = '',
info = ''
},
color_error = colors.red,
color_warn = colors.yellow,
color_info = colors.cyan
@ -176,7 +203,10 @@ ins_right {
return msg
end,
icon = '',
color = {fg = '#ffffff', gui = 'bold'}
color = {
fg = '#ffffff',
gui = 'bold'
}
}
-- Add components to right sections
@ -184,27 +214,40 @@ ins_right {
'o:encoding', -- option component same as &encoding in viml
upper = true, -- I'm not sure why it's upper case either ;)
condition = conditions.hide_in_width,
color = {fg = colors.green, gui = 'bold'}
color = {
fg = colors.green,
gui = 'bold'
}
}
ins_right {
'fileformat',
upper = true,
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
color = {fg = colors.green, gui = 'bold'}
color = {
fg = colors.green,
gui = 'bold'
}
}
ins_right {
'branch',
icon = '',
condition = conditions.check_git_workspace,
color = {fg = colors.violet, gui = 'bold'}
color = {
fg = colors.violet,
gui = 'bold'
}
}
ins_right {
'diff',
-- Is it me or the symbol for modified us really weird
symbols = {added = '', modified = '', removed = ''},
symbols = {
added = '',
modified = '',
removed = ''
},
color_added = colors.green,
color_modified = colors.orange,
color_removed = colors.red,
@ -213,7 +256,9 @@ ins_right {
ins_right {
function() return '' end,
color = {fg = colors.blue},
color = {
fg = colors.blue
},
right_padding = 0
}

Loading…
Cancel
Save