I often open multiple files in vim using tab pages:
$ vim --help | grep tab -p[N] Open N tab pages (default: one for each file) I also use find with xargs and grep -l to obtain a list of files.
find . -type f -name "*.rs"txt" | xargs grep -l "fs::""some text" I can then quickly review the files output by find in vim:
vim -p `find . -type f -name "*.rs"txt" | xargs grep -l "fs::"`"some text"` The earlier grep command would fail if there are spaces in the files or directories, so -print0 can be added to the arguments to find; and -0 can be added to the arguments to xargs:
find . -type f -name "*.rs"txt" -print0 | xargs -0 grep -l "fs::""some text" But if I then try to pass the output of this command to vim tab pages (as below), the paths including spaces are split, and opened as non-existent files. Is there a way to get past the problem?
vim -p `find . -type f -name "*.rs"txt" -print0 | xargs -0 grep -l "fs::"`"some text"`