Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

I'm looking for a function to check wether

:view
is set or not.

Couldn't find a function or &option to check this.

Background: Want to toggle view with a new key mapping similar to this question on stackoverflow, but want to have resize panes back to same size if (file-pre)view is disabled.

1 Answer

0 votes
by
edited by

I checked the sources (in case I forgot something) and looks like results of your search are correct, state of preview isn't exposed anywhere. Will add it as an option ('quickview').

At the moment I can think of a horrific workaround which involves saving vifminfo to get state of the preview, but I'm not sure you'll want to use it.

Somewhat different way might be to set a $VARIABLE whenever you call :view and check it later (how well it will work depends on operations you perform).

by

An option for checking the view-state will be the best. Thanks

Writing vifminfo with :write; checking $MYVIFMRC for q1 in the TUI-Section; changing pane-size with <c-w>| or <c-w>= depending on result followed by :view... I will try this as workaround.

Setting a $VARIABLE involves also checking $MYVIFMRC (at least at startup) , so the former workaround will do it until the option is added.

Thanks for fast help and thanks for vifm

by

Thanks for adding the quickview option this fast

by

Is this option available in 0.9.1?

by

No, 0.9.1 was released earlier than it was added.

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.
...