statusline default - :set stl&

16 views
Skip to first unread message

Sven Guckes

unread,
May 31, 2021, 4:42:32 AM5/31/21
to VIM Users List
when you start with "vim -u NONE" then there is a statusline.
filename, modification status, ruler (line,column) and percentage.

but when you look at the setting with ":set statusline" then
nothing is shown. so i suppose an internal default value is used.

but how to show it? the ":help statusline" does not list it.
and with ":set statusline&" is goes back to empty again. :-/

i am aware of the examples in options.txt, and yet i think
that ":set stl" should show something else than an empty value.
or rather, when this value is empty then nothing is shown at all. ;)

Sven


$ cd vim; rg -w BOT .
./src/option.h
340:#define STL_ALTPERCENT 'P' // percentage as TOP BOT ALL or NN%

$ cd vim; rg %l,%c .
./runtime/doc/options.txt
7417: :set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
7419: :set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P

Examples:
Emulate standard status line with 'ruler' set >
:set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P

Bram Moolenaar

unread,
May 31, 2021, 1:23:47 PM5/31/21
to vim...@googlegroups.com, Sven Guckes, VIM Users List

Sven wrote:

> when you start with "vim -u NONE" then there is a statusline.
> filename, modification status, ruler (line,column) and percentage.
>
> but when you look at the setting with ":set statusline" then
> nothing is shown. so i suppose an internal default value is used.
>
> but how to show it? the ":help statusline" does not list it.
> and with ":set statusline&" is goes back to empty again. :-/
>
> i am aware of the examples in options.txt, and yet i think
> that ":set stl" should show something else than an empty value.
> or rather, when this value is empty then nothing is shown at all. ;)

There are two ways to look at this. In general, when you make an option
empty and then later check the value, you expect it to still be empty.

We don't really have a mechanism to show what is used as "the builtin
default". And for 'statusline' I think the only reason to get this is
so you can change it. Then you need to look at the help for
'statusline' anyway, and you can find the example.

--
An indication you must be a manager:
You feel sorry for Dilbert's boss.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages