nvim-config-kickstart/lua/statusline.lua
2025-05-06 17:06:46 +02:00

49 lines
1.1 KiB
Lua

-- Character, word and line counts
-- https://www.reddit.com/r/neovim/comments/1130kh5/comment/j8navg6/
local function counters()
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
-- See `:help lualine.txt`
require('lualine').setup({
options = {
icons_enabled = true,
theme = 'rose-pine',
component_separators = '|',
section_separators = '',
},
sections = {
lualine_c = {
{
'filename',
path = 1,
}
},
lualine_y = {
{ counters },
'progress'
}
},
inactive_sections = {
lualine_c = {
{
'filename',
path = 1,
}
},
},
symbols = {
error = "",
warn = "",
info = "",
hint = "",
}
})