This question already has an answer here:
I'm analyzing a regression of thousands of test cases in linux. So I want to open many files(failed) in
gvim at once.
I have a file as mention in below with 100+ lines specifying 100+ files in a directory. I want to open all these files in
100+ lines like this.
Is there any way to open files in all these files in
gvim with some navigation mechanism.
I know it is possible to use,
gvim file1 file2 .....
But it is not easy with 100+ files.
I need to do this in
gvim, not in
Best How To :
I just used
find . -name DIFF | xargs vim and was able to navigate through all the files using
Only ugly bit was when I hit about 1500 files I'd get two invocations of vim and would have to finish editing the first 1500 files before moving on to the next 1500 (Due to the way xargs works).
Another option is to use vims error file parsing. List all the files in an file with information about the line and error, open that file and run
:cbuffer in that buffer (it will close the error file and move you to the first listed erro).
:copen will open the list of errors as the Quickfix List. Then you can use the usual
:cp to move between forward and backward in the quickfix list (and
<CR> in the quickfix list will work too. Something like this should work out of the box for you.
:./Linux2/Lint/case1/DIFF:1: Not really an error
:./Linux2/Lint/case2/DIFF:1: Not really an error
:./Linux2/Lint/case3/DIFF:1: Not really an error
Now this can be improved since vims error parsing is flexible. You could remove the requirement for the leading
: by using
set errorformat=%f:%l:\ %m or just use a raw list of files using