I want to for loop analog for vifm.
When I don't select any file I can type :!echo %f and I see output of echo with current file name as argument.
When I select several files :!echo %f yields output of echo with all selected filenames joined with spaces as argument.
What if I want to apply any program (e.g. echo) to each selected file? So
echo file1 file2 file3
What options do I have?
P.S. I want analog of bash code like this:
for f in file1 file2 file3; do
There is no for-each mechanism, so you need to write the loop explicitly like in:
:%!for i in %f; do echo "$i"; done
Maybe define a command like
command! foreach for f in %f; do %a; done
to shorten what you have to type down to
%foreach echo "$f"