Fixing the position of items in vim's statusline
Posted
by ldigas
on Super User
See other posts from Super User
or by ldigas
Published on 2010-03-30T23:53:43Z
Indexed on
2010/03/31
0:03 UTC
Read the original article
Hit count: 403
My statusline looks something like this:
set statusline+=%m
set statusline+=b%n:
" set statusline+=%f
set statusline+=%F
set statusline+=%R
set statusline+=%Y
set statusline+=\
set statusline+=[
set statusline+=row\ %l/%L
set statusline+=,\
" set statusline+=column\ %c\ (%v)
set statusline+=column\ %v\ (%c)
set statusline+=]
which, on an average day, when there is no clouds, gives something like this:
[-]b3:options.txt,RO,HELP [row 6291/7778, column 42 (29)]
Now, when I go about splitting windows, and opening different files, some of them modified, some of them not, the things in the statusline start to wiggle back and forth, and it annoys me to no end.
I saw in vim's help (:help 'statusline) that one can set a fixed width of some items.
How would you go about fixing the above items in a way, that if one item is missing, or no matter of its width, that it doesn't affect the other ones ? (i.e. so I can always look at a known position and know what is there ... not move my eyes left and right searching for the thing I need).
© Super User or respective owner