If you did not have an open file or unmodified buffer:
:edit file1.txt :vert diffsplit file2.txt
To open diff in a new tab,
:tabedit file1.txt :vert diffsplit file2.txt
it would be very convenient
To automate the work, I would think
diffprogram | grep -w '^diff between' | grep 'found$' | while read diff between file1 and file2 found; do gvim -d "$file1" "$file2" done
Notes:
- does not work for file names with special characters (especially spaces).
- To open all these vims at once, simply add
& : gvim -d "$file1" "$file2"&
You can also get all the differences to open in separate tabs in one vim:
gvim --servername GVIM --remote-silent +"tabedit $file1" +"vert diffsplit $file2"
source share