vifm: How to set right window to see content of dir or file highlighted in left window

Solution 1:

For versions prior to 0.8.1 (released on 2016-01-17)

Add command similar to the following one to your ~/.vifm/vifmrc file as one of the last of :fileview commands (because the order in which they appear matters and you don't want it to follow fileview *):

fileview */ tree %c

For 0.8.1 and up

Previewing directories is builtin now, just don't redefine viewer for */ and it will work (you can use *[^/] pattern for :fileviewer command to don't match directories).


Then turn on quick view with:

view

You can add this command to your vifmrc. Or add tui to 'vifminfo' (e.g. with set vifminfo+=tui in vifmrc) to make vifm save quick view state between sessions.

Extra

I also would suggest to add a mapping to switch quick view mode with a key in normal mode to your ~/.vifm/vifmrc file:

nnoremap w :view<cr>

By the way

Sample configuration file of vifm contains commands like these.

(like in ranger)

If you need closer resemblance, take a look at 'millerview' and 'milleroptions' options.

Solution 2:

I'm not yet allowed to comment, so I provide an answer to get my points.

In addition to xaizek's answer

fileview */ tree %c

I have added

fileview ../ tree %c -L 1

below that to be able to see what is in the parent directory while scanning the contents of a directory. This is just for cosmetic completeness. (parent directory is not picked up by */)