feat(lualine): add counters to lualine
- Word, character and line counters upon selection - From https://www.reddit.com/r/neovim/comments/1130kh5/comment/j8navg6/
This commit is contained in:
parent
031e7694a5
commit
e934e38bd0
@ -179,6 +179,23 @@ require('lazy').setup({
|
|||||||
path = 1,
|
path = 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
lualine_y = {
|
||||||
|
{
|
||||||
|
-- Character, word and line counts
|
||||||
|
-- https://www.reddit.com/r/neovim/comments/1130kh5/comment/j8navg6/
|
||||||
|
function()
|
||||||
|
local isVisualMode = vim.fn.mode():find("[Vv]")
|
||||||
|
if not isVisualMode then return "" end
|
||||||
|
local starts = vim.fn.line("v")
|
||||||
|
local ends = vim.fn.line(".")
|
||||||
|
local lines = starts <= ends and ends - starts + 1 or starts - ends + 1
|
||||||
|
local wordcount = vim.fn.wordcount()
|
||||||
|
return tostring(wordcount.visual_words) ..
|
||||||
|
"W " .. tostring(wordcount.visual_chars) .. "C " .. tostring(lines) .. "L"
|
||||||
|
end
|
||||||
|
},
|
||||||
|
'progress'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user