My problem is gone (it's was a PEBKAC).
Here's what happened:
I edited a file, typed something in, then decided that the file is
better saved in a different directory so I moved the file to that
other directory. I typed more stuff into the file and save it. I don't
remember the exact steps I took to do the file move.
Move forward a few hours later, I open the file in its new location
and I only see the first content that I typed in before, not the
latest! So I thought I must have made this mistake:
<thinking>
1. Edited a file, saved (without quitting vim).
2. In another terminal, *copied* the file to its new location.
3. Edited the file (in the same vim session), added more content, saved.
4. In that other terminal, I deleted the 'old' file.
</thinking>
When I opened the file in its new location I see the old content.
At this point my thought was *!#*!#&!*@W!Y&#*!&.
Then I remember that vim have a swap file and in that old directory
there's exactly one swap file left over from some previous vim editing
session.
I created a new file with the same name as the file that the swap file
is associated with but when I opened it in vim vim just created a new
swapfile, 'ignoring' the old one.
That's when I decided to ask the list.
My attempts at using the :recover command failed (after creating a
file with the same name as what the swap file is associated with) with
a message saying that the swap file is broken.
That was last Friday.
Fast forward to today (Monday):
Frustrated by this I decided enough is enough. I gotta handle it like
a man: Don't fret over the lost bytes. So I proceeded with deleting
the stale swap file.
Then I go to the new directory where the file was moved to and opened
the file and vim happily told me that a swap file exist for that file
and when I choose recover *blam* the latest content of that file that
I thought is gone forever is there, every single character!
Heheh.. if that is not a case of PEBKAC then I don't know what is :)
nazri.
P/S: If you are curious the file contains usernames and passwords for
"fake" gmail accounts to test out the web app in my $day_job.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment