Madhav Kobal's Blog

This blog will be dedicated to Linux, Open Source and Technology news, affairs, how-tos and virtually EVERYTHING in these domains.

Visual File Diff with Vimdiff

Posted by madhavkobal on 19/06/2010

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.

Fig: Whole line difference in Vimdiff (click on image to enlarge)

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.

Fig: Partial line difference in Vimdiff (click on the image to enlarge)

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: