View differences of more than one pair of files with vimdiff

vimdiff shows the differences between two or more identical files. Is it possible to see the differences between the two pairs of files. For example, when viewing differences in .H and .C , it will be convenient to go back and forth to see the differences. One way is to open old.C new.C old.H new.H with vim, then split them and run :diffthis in each buffer. Is there a better way?

+4
source share
1 answer

When you use vimdiff , it will transfer all transferred files together. To get pairwise different, go through and arrange the pairs on separate tabs:

 vim -c "edit old.C" -c "diffsplit new.C" -c "tabedit old.H" -c "diffsplit new.H" 

If you do this often, you can write a wrapper for the alias / script.

+5
source

Source: https://habr.com/ru/post/1441474/


All Articles