Joseph WU wrote:
Hi, Vimmer,
Sorry to disturb you, it's a bit urgent. :(
I coded a script in gvim just a hour ago and kept it opening when I
was doing something else. After I returned to gvim, it prompted me
that a file has been modified. At that time, I didn't realize it was
that script file I coded, due to a lot of files opening. I just
pressed the "load" button quickly without any check. But, oops, all
the codes I wrote were completely gone.... :( (even now, I didn't
remember when and how I removed that file.)
I just found a .swp file in /tmp and open it in binary mode. Thanks
god, the .swp file seems containing almost all of the codes I wrote in
this morning. But when I use "gvim -r foo.txt", although vim told me
it is recovered successfully, but no any code recovered, and I still
get NOTHING.
I found the codes in the .swp file are stored in inversed order, so it
is really tedious to manually copy/paste to a new file. So I am
wondering if there is any solution to just get some codes back based
on the .swp file.
Thanks in advance!
Instead of "recovering", try hitting u until you get to the desired state of
the file. If Vim says you're already at the oldest change (because of the
reload) then you're out of luck. The earlier you try this, the more chances of
making it work.
Best regards,
Tony.
--
"The difference between a misfortune and a calamity? If Gladstone fell
into the Thames, it would be a misfortune. But if someone dragged him
out again, it would be a calamity."
-- Benjamin Disraeli