How can I restore a vim file from the undo
file without hitting undo
?
I had a vim file that I saved while adding text. Then I ran a python comm
As the other answers have noted, you can't recover the whole file from vim's undo files, simply because vim seems to only keep diffs in the undo files, not the whole contents. (That makes a lot of sense, as it's space efficient.)
One thing you can try though, is to extract what's possible from your undo file:
$ strings
The output will not be pretty, but you could end up finding something that's valuable to you.