vifm.vim icon indicating copy to clipboard operation
vifm.vim copied to clipboard

Use Vifm as a side bar?

Open GNOMES opened this issue 2 years ago • 3 comments

I currently use Netrw in Neovim, and Vifm outside of Neovim, and realized it's funny to learn two different file browsers in/out of Neovim.

I ran across this request to use Vifm as a vertical split like Nerd-tree:

https://github.com/vifm/vifm.vim/issues/19

I might be misunderstanding the additions this request implemented.

The current implementation after playing with it seems that Vifm in vim/nvim opens up in a split (SplitVifm/VsplitVifm) or full screen (Vifm), and will either open a file in the current window or a split. This closes Vifm, thus hiding the file tree.

My desired implementation would be to have Vifm persist on a vertical split, opening files in the current files window (vifm | file), or create a split to the side of current file (vifm | file 1 | file 2, or vifm | file 1/file2). This would be similar to netrw_preview = 1.

Is this possible?

GNOMES avatar Aug 26 '22 04:08 GNOMES

That issue was basically about location on the screen rather than about persistence.

Opening a file and not closing would need a communication channel between Vifm and host (right now Vifm just writes a file and Vifm.vim reads it after Vifm exits). Does Neovim have a feature analogous to Vim's terminal API as mentioned here? It would probably be the best way of implementing it, but it's not all that's needed.

xaizek avatar Aug 27 '22 12:08 xaizek

I agree this would be an interesting feature.

Opening a file and not closing

If this part is hard to implement, I wonder if there is a way to immediately relaunch Vifm in a split, after picking a file.

It's already possible to do this manually, but it's quite cumbersome:

  1. :vert Vifm
  2. Pick a file
  3. :vert Vifm again
  4. <C-w>w, to switch focus to the file

qadzek avatar Oct 20 '23 15:10 qadzek

immediately relaunch Vifm in a split, after picking a file.

That's a huge crutch that will be noticeable. reveal.nvim does communication with a pipe using workarounds, so it can be done especially with the help of better Lua API.

xaizek avatar Oct 20 '23 21:10 xaizek