Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just opened a long code file in VIM and got the message that a temporary swap file for the file already exists. Both the temporary swap file and the extant file have identical timestamps. I would like to diff them, but the temporary swap file is binary. Can VIM show to me the differences between the two files?

Note that I tried to open the temporary swap file with the "Recover" option in VIM and then just vimdiff it with the extant file. However, that gave to me the message "Recovery completed. Buffer contents equals file contents" which is nice to know, but I would still like to know how to diff the files beforehand in the event that they don't match. In that case, is it still viable to open the temporary swap file in VIM and then vimdiff it with the extant file?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Have a look at the recover.vim plugin. It installs a hook that asks you what to do when a swap file has been detected, and offers to show a diff.

share|improve this answer
    
Thank you Ingo! –  dotancohen Dec 28 '12 at 16:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.