Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I set the right window to see the content of the highlighted directory or file in the left window in vifm? (like in ranger)

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Solution

Add command similar to the following one to your ~/.vifm/vifmrc file as the last of :fileview commands (because the order in which they appear matters):

fileview */ tree %c

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 all this commands.

share|improve this answer

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 */)

share|improve this answer

I don't think you can without, possibly, writing your own command.

vifm is designed as a Midnight Commander like two-pane file explorer. It means that each pane can be considered as a "source" or "target" for your file manipulations. The right pane is pretty much totally disconnected from the left pane and can't be consired a "preview" of the content of some directory on the left pane.

ranger is designed after Mac OS X's Finder's column view where you don't have that notion of "source/target".

I guess it's one style or another. I've got both on all my machines and can't decide which one to throw away as each program has its strong points.

share|improve this answer
    
As long as nobody answers they know how to do it I'll mark this answer as the most suited answer to this question. I also have both installed and I have the same considerations. –  Bentley4 Jul 29 '12 at 20:41
    
@romainl you are mistaking about vifm. It has :fileview and :view commands to handle quick view of selected file in the second pane. Different preview programs can be selected with globals. vifm can also be used in one-pane mode with marks and :pushd/:popd support. It also has less-like preview mode. –  xaizek Jul 30 '12 at 21:42
    
No, I'm not mistaken about vifm. :view only allows to "preview" files while the OP wants to see the content of a directory. I wrote in the 1st line of my answer that he would need to write is own command to achieve his goal and you showed him how to write such a command. One thing I totally failed at (and that I only see right now, as I'm writing this comment) was reading carefully the question: I focused on the "viewing directories" part and totally missed the "viewing files" part. I'll be happy to give you the tick. –  romainl Jul 31 '12 at 5:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.