Running vim that way uses the output of 'ls' as commands to execute.
For example:
echo -e "ihello\e:w! /tmp/vimout.txt\n:q\n" | vim
would use vim to do about the same thing as
echo "hello" >/tmp/vimout.txt
What you were looking for is something like
ls | vim -
where the dash at the end tells vim to treat the text on its standard
input as a buffer to be edited, rather than commands to be run.
~Matt
To edit the file on stdin (the output of ls) add a dash at the end of
the Vim command-line.
See :help --
Normally, Console Vim expects stdin to be the keyboard and stdout to be
the display. Here, you are reassigning stdin to something other than
keyboard commands to Vim, so you need to tell it about the change.
Best regards,
Tony.
--
Please take note: