vifm / vifm.vim

Vim plugin that allows use of vifm as a file picker
325 stars 18 forks source link

Use Vifm as a side bar? #81

Open GNOMES opened 1 year ago

GNOMES commented 1 year ago

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?

xaizek commented 1 year ago

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.

qadzek commented 8 months ago

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
xaizek commented 8 months ago

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.