vim: more tweaks to lualine

1. Show the filename in italics if file is modified.
2. Put the plus sign on the right of the filename and make it stand out.
3. The symbols I was using were not rendering well on macOS and don't
   really have the time to debug this now. Just use simpler line.
This commit is contained in:
Fernando Schauenburg 2022-10-25 20:55:14 +02:00
parent 8242d356bc
commit f3a493d6f6

View file

@ -68,7 +68,6 @@ local parts = {
local code = vim.api.nvim_get_mode().mode
return MODE_MAP[code] or code
end,
padding = 0,
},
visual_multi = function()
@ -80,7 +79,6 @@ local parts = {
branch = {
'branch',
icon = '',
padding = 0,
cond = window_is_medium,
},
@ -95,10 +93,12 @@ local parts = {
end
return table.concat(flags, ' ')
end,
padding = { left = 1, right = 0 },
color = { fg = '#eee8d5' },
},
filename = function()
filename = {
function()
local shorten_path = function(path)
if window_is_wide() then
return path
@ -112,6 +112,15 @@ local parts = {
return shorten_path(vim.fn.expand('%:~:.'))
end,
color = function()
if vim.bo.modified then
return { gui = 'italic' }
end
end,
padding = { left = 1, right = 0},
},
filetype = {
filetype,
cond = window_is_medium,
@ -119,7 +128,6 @@ local parts = {
fileformat = {
'fileformat',
padding = { left = 0, right = 1 },
cond = window_is_medium,
},
@ -132,27 +140,22 @@ local parts = {
padding = { left = 0, right = 1 },
cond = window_is_wide,
},
location = {
'location',
padding = { left = 0, right = 1 },
},
}
local inactive_sections = {
lualine_a = {},
lualine_b = { parts.visual_multi, parts.branch, parts.status },
lualine_c = { parts.filename },
lualine_b = { parts.visual_multi, parts.branch },
lualine_c = { parts.filename, parts.status },
lualine_x = { 'diagnostics', parts.filetype },
lualine_y = { parts.fileformat, parts.progress },
lualine_z = { parts.location },
lualine_z = { 'location' },
}
require('lualine').setup {
options = {
icons_enabled = true,
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
theme = 'solarized',
},