Switch to newer lualine fork

This commit is contained in:
ViViDboarder 2021-10-21 10:24:28 -07:00
parent 8bc5c38067
commit c4d688ef51
2 changed files with 14 additions and 34 deletions

View File

@ -85,7 +85,7 @@ return require('packer').startup(function()
} }
--]] --]]
use { use {
"hoob3rt/lualine.nvim", "shadmansaleh/lualine.nvim",
config = function() require("plugins.lualine").config_lualine(vim.g.colors_name) end, config = function() require("plugins.lualine").config_lualine(vim.g.colors_name) end,
} }
use { use {

View File

@ -8,27 +8,7 @@ function M.custom_ffenc()
return enc .. "[" .. format .. "]" return enc .. "[" .. format .. "]"
end end
return nil return ""
end
-- Use only single letters for mode names
function M.single_letter_mode()
local mode_map = {
['__'] = '-',
['n'] = 'N',
['i'] = 'I',
['R'] = 'R',
['c'] = 'C',
['v'] = 'V',
['V'] = 'V',
[''] = 'V',
['s'] = 'S',
['S'] = 'S',
[''] = 'S',
['t'] = 'T',
}
return mode_map[vim.fn.mode()]
end end
function M.mixed_indent() function M.mixed_indent()
@ -42,7 +22,7 @@ function M.mixed_indent()
return "i:" .. require("math").max(tab_indent, space_indent) return "i:" .. require("math").max(tab_indent, space_indent)
end end
return nil return ""
end end
function M.trailing_whitespace() function M.trailing_whitespace()
@ -51,7 +31,7 @@ function M.trailing_whitespace()
return "tw:" .. line return "tw:" .. line
end end
return nil return ""
end end
-- Configure lualine witha provided theme -- Configure lualine witha provided theme
@ -69,19 +49,19 @@ function M.config_lualine(theme_name)
options = { options = {
theme = theme_name, theme = theme_name,
icons_enabled = false, icons_enabled = false,
component_separators = {"|", "|"}, component_separators = {left = "|", right = "|"},
section_separators = {"", ""}, section_separators = {left = "", right = ""},
}, },
sections = { sections = {
lualine_a = { M.single_letter_mode }, lualine_a = {{"mode", fmt = function(str) return str:sub(1, 1) end}},
lualine_b = { "FugitiveHead", "diff" }, lualine_b = {"FugitiveHead", "diff"},
lualine_c = { "filename" }, lualine_c = {"filename"},
lualine_x = { M.custom_ffenc, "filetype" }, lualine_x = {M.custom_ffenc, "filetype"},
lualine_y = { "progress", "location" }, lualine_y = {"progress", "location"},
lualine_z = { lualine_z = {
{ "diagnostics", sources = { "nvim_lsp" } }, {"diagnostics", sources = {"nvim_lsp"}},
{ M.mixed_indent, color = { bg = "#de4f1f" } }, {M.mixed_indent, color = {bg = "#de4f1f"}},
{ M.trailing_whitespace, color = { bg = "#de4f1f" } }, {M.trailing_whitespace, color = {bg = "#de4f1f"}},
}, },
}, },
} }