vim: use moon in statusline for progress
This commit is contained in:
parent
cfb1802c59
commit
4321433d73
1 changed files with 10 additions and 5 deletions
|
@ -81,7 +81,7 @@ local parts = {
|
||||||
icon = '',
|
icon = '',
|
||||||
},
|
},
|
||||||
|
|
||||||
diff = {
|
diff= {
|
||||||
diff,
|
diff,
|
||||||
diff_color = {
|
diff_color = {
|
||||||
added = { fg = colors.green },
|
added = { fg = colors.green },
|
||||||
|
@ -95,27 +95,32 @@ local parts = {
|
||||||
|
|
||||||
filetype = filetype,
|
filetype = filetype,
|
||||||
|
|
||||||
location = '%3l:%-2v',
|
fileformat = {
|
||||||
|
'fileformat',
|
||||||
|
padding = { left = 0, right = 1 },
|
||||||
|
},
|
||||||
|
|
||||||
progress = {
|
progress = {
|
||||||
function()
|
function()
|
||||||
local chars = { '█', '▇', '▆', '▅', '▄', '▃', '▂', '▁', ' ' }
|
local chars = { '', '', '', '', '', '', '', '', '', '', '', '', '', '', '' }
|
||||||
local current, total = vim.fn.line '.', vim.fn.line '$'
|
local current, total = vim.fn.line '.', vim.fn.line '$'
|
||||||
return chars[math.ceil(#chars * current / total)]
|
return chars[math.ceil(#chars * current / total)]
|
||||||
end,
|
end,
|
||||||
padding = 0,
|
padding = { left = 0, right = 1 },
|
||||||
color = {
|
color = {
|
||||||
fg = theme.normal.b.bg,
|
fg = theme.normal.b.bg,
|
||||||
bg = theme.normal.c.bg,
|
bg = theme.normal.c.bg,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
location = '%3l:%-2v',
|
||||||
}
|
}
|
||||||
|
|
||||||
local sections = Table:new {
|
local sections = Table:new {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = { parts.branch, parts.diff, parts.split, parts.path },
|
lualine_c = { parts.branch, parts.diff, parts.split, parts.path },
|
||||||
lualine_x = { 'diagnostics', parts.filetype, 'fileformat' },
|
lualine_x = { 'diagnostics', parts.filetype, parts.fileformat, parts.progress },
|
||||||
lualine_y = { parts.location },
|
lualine_y = { parts.location },
|
||||||
lualine_z = {},
|
lualine_z = {},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue