diff --git a/lua/plugins-configure.lua b/lua/plugins-configure.lua index 9c699e1..5d0190e 100644 --- a/lua/plugins-configure.lua +++ b/lua/plugins-configure.lua @@ -179,6 +179,23 @@ require('lazy').setup({ 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 = { lualine_c = {