I build my own statusline because I don't need such fancy things inside my statusline as some plug-ins provides. Usually everything is fine. The result looks like the following:
NORMAL | ~/.config/nvim/lua/statusline.lua | + | ft:LUA| buf:1| 1/123:23
But if I open a file with a deep nested path, my statusline swallows up my mode section. Like:
<ocal/share/nvim/site/pack/packer/start/zenburn.nvim/lua/zenburn/palette.lua/nvim/lua/statusline.lua | ft:LUA| buf:1| 1/123:23
This happens even if I put a minimal width on my mode section. Here is my function to create the statusline:
local function create_statusline(mapped_mode)
local statusline_raw = {
"%#", mapped_mode.hl, "#",
" %7(", -- Breite des Mode (zusammen 9 Zeichen)
mapped_mode.text, -- Mode
"%) ", -- Schließt Mode-Teil
"%*", -- Stellt eigentliche Highlightgroup wieder her
" %F", -- Filename + Path
" |", -- Separator
" %.5(%M %R%)", -- Modifier +, ro
"%=", -- rechte Seite
" :%Y", -- FileType
" :%n", -- BufferNr
" %l/%L:%c", -- Line/line_count:column
} )
return table.concat(statusline_raw)
end
The mapped_mode is a table with the text and a highlight group name as elements. The comments are a mix of German and English.
I think I don't understand the meaning of {minwid}. I hope some of you can help me out to get the mode section all the time in my statusline.