2
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?
1There'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 – 2013-08-17T19:07:25.810