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:
parent
8242d356bc
commit
f3a493d6f6
1 changed files with 48 additions and 45 deletions
|
@ -68,7 +68,6 @@ local parts = {
|
||||||
local code = vim.api.nvim_get_mode().mode
|
local code = vim.api.nvim_get_mode().mode
|
||||||
return MODE_MAP[code] or code
|
return MODE_MAP[code] or code
|
||||||
end,
|
end,
|
||||||
padding = 0,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
visual_multi = function()
|
visual_multi = function()
|
||||||
|
@ -80,7 +79,6 @@ local parts = {
|
||||||
branch = {
|
branch = {
|
||||||
'branch',
|
'branch',
|
||||||
icon = '',
|
icon = '',
|
||||||
padding = 0,
|
|
||||||
cond = window_is_medium,
|
cond = window_is_medium,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -95,10 +93,12 @@ local parts = {
|
||||||
end
|
end
|
||||||
return table.concat(flags, ' ')
|
return table.concat(flags, ' ')
|
||||||
end,
|
end,
|
||||||
padding = { left = 1, right = 0 },
|
|
||||||
|
color = { fg = '#eee8d5' },
|
||||||
},
|
},
|
||||||
|
|
||||||
filename = function()
|
filename = {
|
||||||
|
function()
|
||||||
local shorten_path = function(path)
|
local shorten_path = function(path)
|
||||||
if window_is_wide() then
|
if window_is_wide() then
|
||||||
return path
|
return path
|
||||||
|
@ -112,6 +112,15 @@ local parts = {
|
||||||
return shorten_path(vim.fn.expand('%:~:.'))
|
return shorten_path(vim.fn.expand('%:~:.'))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
color = function()
|
||||||
|
if vim.bo.modified then
|
||||||
|
return { gui = 'italic' }
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
padding = { left = 1, right = 0},
|
||||||
|
},
|
||||||
|
|
||||||
filetype = {
|
filetype = {
|
||||||
filetype,
|
filetype,
|
||||||
cond = window_is_medium,
|
cond = window_is_medium,
|
||||||
|
@ -119,7 +128,6 @@ local parts = {
|
||||||
|
|
||||||
fileformat = {
|
fileformat = {
|
||||||
'fileformat',
|
'fileformat',
|
||||||
padding = { left = 0, right = 1 },
|
|
||||||
cond = window_is_medium,
|
cond = window_is_medium,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -132,27 +140,22 @@ local parts = {
|
||||||
padding = { left = 0, right = 1 },
|
padding = { left = 0, right = 1 },
|
||||||
cond = window_is_wide,
|
cond = window_is_wide,
|
||||||
},
|
},
|
||||||
|
|
||||||
location = {
|
|
||||||
'location',
|
|
||||||
padding = { left = 0, right = 1 },
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local inactive_sections = {
|
local inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = { parts.visual_multi, parts.branch, parts.status },
|
lualine_b = { parts.visual_multi, parts.branch },
|
||||||
lualine_c = { parts.filename },
|
lualine_c = { parts.filename, parts.status },
|
||||||
lualine_x = { 'diagnostics', parts.filetype },
|
lualine_x = { 'diagnostics', parts.filetype },
|
||||||
lualine_y = { parts.fileformat, parts.progress },
|
lualine_y = { parts.fileformat, parts.progress },
|
||||||
lualine_z = { parts.location },
|
lualine_z = { 'location' },
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = 'solarized',
|
theme = 'solarized',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue