Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by
edited by

in /src/ui/statusline.c

there is a static constant array with dynamics tips

They appears in the status line below the panels and changes

(time-based or movement-triggered ?) and it's helping a lot when

we are Newbies with the beautiful file manager VIFM.

1 Space after :command name is sometimes optional: :chmod+x",
2 [count]h moves several directories up, e.g. for cd ../..: 2h",
3 :set options without completions are completed with current value"
4 :help command completes matches by substring match",
5 'classify' can be used to decorate names with chars/icons",
6 You can rename files recursively via :rename!",
7 t key toggles selection of current file",
8 :sync command navigates to the same location on the other panel",

When teaching friends how to use VIFM, I often zoom in (Ctrl++) to increase the font size for better visibility. However, this causes the tips in the status bar to truncate, making them hard to read.

To improve the VIFM experience, I tought maybe a duplicate status bar

line with in the first one only the string of the tip and in the second
one the other information
could be helpful.

The duplicate line with tips could have a toggle shortcut to hide it if necessary.

1 Answer

0 votes
by

The macro for a break in the statusline is %N (docs), so something like:

set statusline='%z%N<all the rest>'

To toggle:

let g:hints = 0
nnoremap <silent> ,H : if !g:hints
                    \|   let g:saved_statusline = &statusline
                    \|   let &statusline = '%z%N'.&statusline
                    \| else
                    \|   let &statusline = g:saved_statusline
                    \| endif
                    \| let g:hints = !g:hints<cr>

changes (time-based or movement-triggered ?)

Mostly time-based, but the status line isn't redrawn just to update the tip. A different tip is shown if enough time has passed since the last change.

by

thank you very much for your answer, it's working !

here it's what I have in VIFMRC:

set statusline=" %z%N%= %A %10u:%-7g %15s %20d  "
nnoremap <silent> ,H : if !g:hints
                \|   let &statusline = " %z%= %A %10u:%-7g %15s %20d  "
                \| else
                \|   let &statusline = " %z%N%= %A %10u:%-7g %15s %20d  "
                \| endif
                \| let g:hints = !g:hints<cr>

Switch is possible with ,H it's nice

I don't know what is let g:hints = 0 for ?

sorry for the typo in the title, we should read

Duplicate the status bar line for educational purpose

in place of

Duplicate the satus bar line for educational purpose

by

let g:hints = 0 avoids the use of a variable that doesn't exist.

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...