Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

hi, i'm planning to implement a plugin that uses vifm inside neovim.

so you may wonder: why not use vifm.vim?
it's written by vimscript, i know little about vimscript, i hardly can built my own rice based on it
i want to make use of neovim's lua api to gain speed advantages, and i know more lua than vimscript

from what i know so far, that's what i am going to do:
the essential part is using neovim's builtin terminal + vifm --choose-files - --choose-dir -
shows vifm in a neovim float window

i do want to reuse this terminal+vifm process, not a oneshot operation, to reduce the overhead/initialization time between each selections.
i saw vifm provides lua api too, but i failed to find an example describes how to use it; i had read vifm.vim/doc/app/vifm-lua.txt, but still have no idea on using it.
if possible, i also plan to use lua inside vifm to communicate with neovim's rpc to achieve this "reuse" goal.

how do you think about my plan? could you point out some falsehood and improvements?

thanks for your reply and time!

1 Answer

+1 vote
by
selected by
 
Best answer

Hi

--choose-dir -

Might be useful only if you plan to use Vifm to do cd in neovim.

i saw vifm provides lua api too, but i failed to find an example describes how to use it

I'm not sure if it will be of much use here unless you want to run some Lua code from a :command or a key binding.

i do want to reuse this terminal+vifm process, not a oneshot operation, to reduce the overhead/initialization time between each selections.

Then --choose-* won't help. I'd probably try to somehow insert :filetype * definition before user's vifmrc and handle selection there. This might be done in Lua, see https://github.com/vifm/vifm/blob/master/data/plugins/mpc/init.lua for an example.

by

thanks for this plugin link, it helps a lot!
for the first approach, i have almost finished it, with --choose-files it's not too hard.
but i'm still going to try the lua way, it's more fun~

(i failed to find the "accept this answer" button)

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.

Support Ukraine
...