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).
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')
\| execute 'wincmd H'
Thank you, it works!
With `execute 'wincmd H'` the selection jumps to the first line. Is it possible to avoid that somehow?
`execute 'wincmd H'
You mean that the cursor moves to the first entry like on pressing gg? execute 'wincmd H' should not do that. Maybe you have edited the command in some way?
execute 'wincmd H'
You're right. I had remapped `<C-w>` to some other vifm command. Without remapping the solution above works as expected. Thank you!
Well, thank you for discovering a bug. :wincmd is supposed to be immune to mappings, I'll fix that.