Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compare two files in emacs, similar to vim's vimdiff?

Tags:

If I do a diff from emacs, I get something that looks like a patch, and the files are concatenated in one big file. Is there any function that I could use to compare them like in this image? It's much easier to see what's changed.

vimdiff

like image 964
Geo Avatar asked Aug 12 '11 09:08

Geo


People also ask

How do I compare two files in Emacs?

The command M-x diff compares two files, displaying the differences in an Emacs buffer named `*diff*' . It works by running the diff program, using options taken from the variable diff-switches . The value of diff-switches should be a string; the default is "-c" to specify a context diff.

How can I compare two files for differences?

Right-click on the first file. Click on “Select for Compare” from the menu. Proceed to right-click on the second file. Click on “Compare with Selected.


1 Answers

Ediff works similarly: M-x ediff

http://www.gnu.org/software/emacs/manual/html_mono/ediff.html

like image 87
Tom Avatar answered Sep 22 '22 21:09

Tom