vifm / vifm.vim

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

Is it possible to open vifm default vifm file opening behavior instead of always 'edit' #87

Open fab4100 opened 1 year ago

fab4100 commented 1 year ago

Sometime I need to browse the local neighborhood of the file I am editing and using vifm is convenient but can be cumbersome to quickly open a file and close it again due to the default 'edit' in the hosting vim behavior.

Is it possible to open vifm inside vim where I could just hit enter on, say, a pdf file for example and that would open in the default pdf viewer instead of opening the binary pdf file in a vim buffer? I can use :file inside vifm but it adds additional overhead for this typically quick type of file browsing. Same for text files, these would open in the vifm session (which is nested in vim) instead of open in a buffer of the hosting vim instance.

Thanks a lot!

xaizek commented 1 year ago

When Vifm is run with --choose-files, default behaviour is overwritten and isn't directly accessible. However, since you want to use the plugin to not use it, maybe just run (wrapped in come custom :command or a mapping):

:term ++close vifm --select %:p

In principle, this plugin could provide a way to do this as well, but currently it doesn't.

fab4100 commented 1 year ago

Makes sense. Thanks a lot!