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.
+1 vote
in vifm by

I'm using vifm usually in the `only` mode, i.e. without splitting.

However, I have this binding which allows me to press F12 for a quick view of the selected files/dirs.

nnoremap <f12> :if layoutis('only') | vsplit | view! | else | only | endif<cr>

The problem: the pane created with vsplit with the quick view sometimes appears on the left, sometimes on the right. Is it somehow possible to make sure that it is always on the right side?

Probably the key command is `paneisat()`, however, I don't know how to swap the panes if the newly created quick view pane is on the wrong side (left).

1 Answer

0 votes
by
edited by
 
Best answer

It's simpler to unconditionally position current pane on the left after the split with Ctrl+W H using :wincmd H (which needs to be wrapped using :execute inside a longer command:

nnoremap <silent> <f12> :if layoutis('only')
                       \|    vsplit
                       \|    execute 'wincmd H'
                       \|    view!
                       \|else
                       \|    only
                       \|endif<cr>
by

Thank you, it works!

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