How To Diff Two Files In Vim

Published Date Author: , Posted February 5th, 2024 at 4:10:35pm

shell> vimdiff file1 file2
~OR~
shell> vim file1 file2
Create a vertical split window: Control-w v
Enable visual diff on the left side: :diffthis
Move the cursor to the right side buffer: Control-w Right-arrow
Enable visual diff on the left side: :diffthis

You should now see the differences highlighted on both sides.

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.