-
Notifications
You must be signed in to change notification settings - Fork 0
/
visual diff tools
33 lines (19 loc) · 1.25 KB
/
visual diff tools
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
http://amjith.blogspot.com/2007/07/visual-diff-tools-in-linux.html
http://amjith.blogspot.com/2008/08/quick-and-dirty-vimdiff-tutorial.html
sdiff file-1 file-2
This is a much more elegant tool compared to diff, if you are looking for a quick command-line
utility that shows the difference between two text files. While using it on big files, its better to pipe the output to less command.
sdiff file1 file2 | less
vimdiff file-1 file-2
This can open "n" number of files in a vertically split vim environment. This has color highlighting to specify the areas
that differ in the file. Editing is possible. This is a complete vim-environment, so all the vim keys are usable.
Here is a quick and dirty tutorial on how to use vimdiff.
Keyboard Shortcuts:
do - Get changes from other window into the current window.
dp - Put the changes from current window into the other window.
]c - Jump to the next change.
[c - Jump to the previous change.
Ctrl W + Ctrl W - Switch to the other split window.
Update: Allan commented these two tips that I personally use quite often.
If you load up two files in splits (:vs or :sp), you can do :diffthis on each window and achieve a diff of files that were already loaded in buffers
:diffoff can be used to turn off the diff mode.