문제

vimdiff shows differences between two or more of same files. Is it possible to see differences of two pairs of files. For eg, when viewing differenes in .H files and .C file, 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 using vim and then splitting them and running :diffthis in each buffer. Is there a better way?

도움이 되었습니까?

해결책

When you use vimdiff, it'll diff all passed files together. To get pairwise diffing, pass and arrange the pairs in separate tab pages:

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 an alias / script wrapper for it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top