Prot On Ediff

Protesilaos Stavrou (Prot) has a really excellent video on Ediff. I’ve always had a difficult relationship with Ediff. It seemed really complicated with lots of obscure commands and, by default, a control panel that resides in a different frame, which didn’t play well with running Emacs full screen as I do. I’d already resolved that last problem but for those of you who haven’t, Prot shows you the secret spell.

More importantly, he demonstrates that using Ediff is actually simple if you ignore all the obscure stuff. With his configuration, the two (or three) diffed files or buffers are shown side by side and a short buffer at the bottom serves as the control panel. By default, the full panel with all the commands aren’t listed—although you can use ? to toggle it—but prot says that doesn’t matter because you hardly ever have to use that other stuff. All you really need to know is n for the next diff, p for the previous diff, and a, b, or c to move the A, B, or C diff to the other buffer(s). That’s it. It covers almost everything you ever really want to do in Ediff.

Prot also demonstrates the Magit Ediff (dwim) command that lets you see how a particular file has changed over a series of commits. It’s easy to use and invoked right from Magit.

Finally, for those who want to configure their Emacs like Prot does for Ediff, here are the two commands you need for side by side buffers and the control panel in the same frame at the bottom:

(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-split-window-function 'split-window-horizontally)

I found this video to be really helpful. Perhaps you will too. The video is 15 minutes, 48 seconds long so you may have to schedule some time.

This entry was posted in General and tagged . Bookmark the permalink.