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 "*.txt" | xargs grep -l "some text" I can then quickly review the files output by find in vim:
vim -p `find . -type f -name "*.txt" | xargs grep -l "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 "*.txt" -print0 | xargs -0 grep -l "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 "*.txt" -print0 | xargs -0 grep -l "some text"`
fs::come from?"*.rs"and.. I've edited the question to make the examples more generic.vim. Maybe you'll be able to find answers on Unix & Linux? Btw, the obvious solution is to never ever use paths with spaces but we all know that already :-)