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.

When my PC crashes for some reason and I open my files again in vim, it asks me to perform recovery on previously opened files. The recovery plugin helps a lot, but in 90% of cases the recovered data is identical to the actual file content. Is there a way how to let vim automatically discard the recovery data in such a case and not prompt me about it?

share|improve this question
1  
There's no built-in automatic way to do it, but the plugin you refer to has all the pieces you need to do this yourself. The plugin detects and intercepts the swap file warning message; it knows whether the contents have changed (it displays the value of 'modified'); it can delete the swap file (e.g., the :FinishRecovery command). All you have to do is hack the plugin so that on detection of a swap file, if the file was not 'modified', delete the swap file and let you continue uninterrupted. It might be a good idea if it used :echomag to tell you that it did that. –  garyjohn Aug 17 '13 at 19:07

1 Answer 1

up vote 2 down vote accepted

I'm the author of the Recovery plugin. It should be possible by setting the variable

let g:RecoverPlugin_Edit_Unmodified=1

in your .vimrc.

share|improve this answer

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.