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

Is it possible to get user input within vifm (from command-line) for a custom bash script?

Let's say I have a bash script to copy selected file(s) to another folders. I select the file(s) in vifm and execute the command. It asks for a number and depending on the input, it copies the chosen file(s) to different folders.

Thank you

1 Answer

0 votes
selected by
Best answer

There is no analogue of Vim's input() function, but you can use %a macro and pass input when invoking a :command.


Could you give me an example of how to use %a and what it does?


It expands to parameters you specify for your custom :command. If you have

command say echo %a

:say bla will invoke echo bla.


got it, thank you

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