I read about how to update the vim statusline here. And I am able to update it successfully.
But, I would like to retain the format of default vim statusline and just add some more info to it e.g. file-size, file-type, etc.
Vim default status line is:
<file-name> line_num,col_num %file
How could I do the following?
- I would like to add info after the file-name
- Display the current format of statusline (
:set statusline
displays nothing)
I tried:
set statusline+=%y
But this overwrites the entire statusline and just displays the file-type (%y
).
Any hints?
Best Answer
Like @muru said, it doesn't seem to possible to exactly simulate the default status line when
statusline
is set as the code for rendering it does things that can't be specified in thestatusline
setting. It is possible to get pretty close, however. Here is a reasonable approximation of the way the default status line looks whenruler
is enabled:The main difference is the positioning of the line and column numbers. If it's possible to simulate the default spacing logic, I haven't been able to figure out a way to do it. Perhaps this will be close enough for your purposes.
I use a split version of this in my own
.vimrc
to place Syntastic status line info in the middle of what looks like a normal vim status line with ruler: