Compare buffer with file on disk

Sometimes you’ll find yourself in the position where you want to see the differences between the unsaved buffer you are editing, and the saved version of the file on the disk. Ediff does this nicely with the command M-x ediff-current-file.


  1. Note that diff-buffer-with-file is also available, so you can use whichever one suits best in any situation. I use a custom wrapper for that, which let-binds (diff-switches "-u") so that the unified diff format is produced, and I have both this and the ediff version bound to keys (C-z = and C-z C-= respectively, as I use C-z as a prefix).


Leave a Reply

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

You are commenting using your 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 )

Connecting to %s