The diff command output can get little confusing to read when you diff two files that has lot of differences. Wouldn’t it be nice to view the file differences visually? vimdiff utility gives a better visual feeling of differences between files as explained in this article.
1. Difference in whole line – Blue Color and Hyphens
If line X is available in one file and not available in another file, then file containing the line will be highlighted with blue color, and the file without that line will be displayed with hypens and in light green color as shown below.
2. Difference in partial line – Red Color
If only a part of the line is different between the two files, the line will be highlighted in rose color, and the partial difference will be highlighted with red color as shown below.
3. Lines are same
If some lines of the two files are same, it will appear as it is ( i.e without any highlight ).
If many lines of the two files are same, it will be folded automatically, and shown as +N lines as shown below. To expand the fold press SPACE.