This commit is contained in:
Michael Peters 2022-10-06 09:09:30 -07:00
commit fb3f1dc100

View File

@ -61,18 +61,12 @@ function M.config()
lualine_a = {},
lualine_b = {},
lualine_c = {
{ -- git branch
"branch",
icon = "",
color = { fg = scolors.branch, gui = "bold" },
padding = { left = 2, right = 1 },
},
{ -- filetype
"filetype",
colored = false,
color = { fg = scolors.filetype, gui = "bold" },
cond = conditions.buffer_not_empty,
padding = { left = 1, right = 1 },
padding = { left = 2, right = 1 },
},
{ -- file name
"filename",
@ -99,7 +93,13 @@ function M.config()
color_warn = { fg = scolors.warn },
color_info = { fg = scolors.info },
},
padding = { left = 2, right = 1 },
padding = { left = 1, right = 1 },
},
{ -- git branch
"branch",
icon = "",
color = { fg = scolors.branch, gui = "bold" },
padding = { left = 1, right = 1 },
},
},
lualine_x = {
@ -139,11 +139,75 @@ function M.config()
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_c = {
{ -- filetype
"filetype",
colored = false,
color = { fg = scolors.filetype, gui = "bold" },
cond = conditions.buffer_not_empty,
padding = { left = 2, right = 1 },
},
{ -- file name
"filename",
color = { fg = scolors.filename, gui = "bold" },
padding = { left = 1, right = 1 },
},
{ -- git diff
"diff",
symbols = { added = "", modified = "", removed = "" },
diff_color = {
added = { fg = scolors.added },
modified = { fg = scolors.modified },
removed = { fg = scolors.removed },
},
cond = conditions.hide_in_width,
padding = { left = 1, right = 1 },
},
{ -- nvim diagnostics
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = { error = "", warn = "", info = "", hint = "" },
diagnostics_color = {
color_error = { fg = scolors.error },
color_warn = { fg = scolors.warn },
color_info = { fg = scolors.info },
},
padding = { left = 1, right = 1 },
},
{ -- git branch
"branch",
icon = "",
padding = { left = 1, right = 1 },
},
},
lualine_x = {
{ -- location in file (line:col)
"location",
padding = { left = 0, right = 1 },
},
{ -- progress through file (%)
-- slightly modified from default "progress"
-- always 3 chars long, no TOP
-- https://github.com/nvim-lualine/lualine.nvim/blob/master/lua/lualine/components/progress.lua
function ()
local cur = vim.fn.line('.')
local total = vim.fn.line('$')
if cur == total then
return 'BOT'
elseif cur / total < 0.10 then
return ' ' .. math.floor(cur / total * 100) .. '%%'
else
return math.floor(cur / total * 100) .. '%%'
end
end,
"progress",
color = { gui = "none" },
padding = { left = 0, right = 1 },
},
},
lualine_y = {},
lualine_z = {},
},
}
}
lualine.setup(config)