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

Hello Vifm users,

Exactly as the title says:

How to visual select files/directories and send them to custom script?

If I press T or V and select some files/dirs, how can a mapping be created to send these visual selection to a custom , let's say "$1"/"$files" stdin script

Thanks in advanced,

1 Answer

0 votes
selected by
Best answer

Hi David,

Running an external command with :! or a user-defined :command while selection is active is enough. For example (list of files as arguments):

nnoremap <silent> ,s :!script %f<cr>

If you want list of files on stdin, use %Pl macro instead:

nnoremap <silent> ,s :!script %Pl<cr>

I didn't really understand what you meant by

"$1"/"$files" stdin script

Please clarify if the above doesn't answer your question.


Hi Xaizek,

Thank you, the first answer is enough, working great.

Best regards from Bolivia,