new: Show total lines in lualine using custom fn
This commit is contained in:
parent
d029e2a06e
commit
fafa7342ce
1 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
local function total_lines()
|
||||||
|
local lc = vim.fn.line('$')
|
||||||
|
if lc < 1 then
|
||||||
|
return ''
|
||||||
|
elseif lc == 1 then
|
||||||
|
return '(1 line)'
|
||||||
|
else
|
||||||
|
return string.format('(%d lines)', lc)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
require("lualine").setup {
|
require("lualine").setup {
|
||||||
options = {
|
options = {
|
||||||
theme = 'moonfly',
|
theme = 'moonfly',
|
||||||
|
@ -6,8 +17,8 @@ require("lualine").setup {
|
||||||
lualine_a = { 'buffers' },
|
lualine_a = { 'buffers' },
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = {},
|
lualine_c = {},
|
||||||
lualine_x = {},
|
lualine_x = { 'filename' },
|
||||||
lualine_y = { 'filename' },
|
lualine_y = { total_lines },
|
||||||
lualine_z = { 'tabs' },
|
lualine_z = { 'tabs' },
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
|
|
Loading…
Reference in a new issue