please what is the correct way to do a loop that works reliably with files containing spaces, "(" etc. this is not working as expected:
command! mycmd \ :execute "!!for i in %f; do echo $i; echo '===='; done"
thank you! jose
Double percent sign like this:
command! mycmd \ :execute "!!for i in %%f; do echo $i; echo '===='; done"
This will postpone expansion of the macro until running :execute instead of doing it before invoking :execute.
:execute
thank you, it works, but not if you
:command
mycmd
looks like just before running it the selection is cancelled. could you please check?
Yeah, I confirm that selection isn't preserved. Thanks.