How can you put a list of files to Vim\'s -o -mode?
I have a list of files as Grep\'s output. I run unsuccessfully
grep -il
To invoke vim
using xargs
, xargs
must be invoked with -o
:
grep -il sid * | xargs -o vim -o
In case filenames could contain spaces, use grep -Z
with xargs -0
grep -ilZ sid * | xargs -0 -o vim -o
Without xargs -o
, we would get a warning:
Vim: Warning: Input is not from a terminal
The -o
option exists on OSX/BSD. Also, the -o
option is found in GNU findutils built from git. This option was added after 4.6.0.