Monday, August 1, 2011

Re: swap files reverting my work erroneously

On 02/08/11 01:50, David Ohlemacher wrote:
> So once you have a swap file from a crash its there forever. That is
> until you delete the swp manually. And if you hit recover, your _newer_
> file contents will be wiped out by an _older_ swap file's contents?
>
> I assumed (word chosen carefully), that once you've recovered from a
> swap file, the swap would be updated to mirror the current buffer.
>
> I think noswapfile will checked into my env repo. When you have 30+
> buffers open, this is not very useful to me.
>
> Thanks Paul. My Vim book does not mention swp files. The online help
> says "The swap file is deleted as soon as Vim stops editing the file".
> But there may be more than one!
>
> -d
>
> On 08/01/2011 06:04 PM, Paul wrote:
>> The swap file stays around when vim crashes, for example. When it asks you if you want to recover, note that it also warns you to check the file and manually remove the swap file. It won't remove it for you. If you don't remove it, vim will detect it every time you open the file, and ask you to recover from it.
>>
>
> --
> David Ohlemacher
> Senior Software Engineer
> Scientific Solutions Inc.
> 99 Perimeter Rd Nashua New Hampshire 03063
> 603-880-3784
>
> . o .
> . . o
> o o o


The Vim help mentions swp files (and swo, swn, etc.) extensively. About
what happens when Vim finds a swap file for the file you're about to
open, see ":help ATTENTION" and the full help section starting there,
until the next line of equal signs.

When a swapfile is found, and you know that it is obsolete (e.g. by
either "Modified: NO" or "NEWER than swap file", or else because you
just recovered the file and restarted), then IMHO the best course of
action is to _D_elete the swapfile. (Then Vim will start afresh with a
new swapfile for your new edit session.)

With Vim, everything is in the help, you don't need additional
documentation. (The help is so extensive that newbie users, and
sometimes even not-so-newbie ones, may get a needle-and-haystack
feeling; but there is help about that too: see ":help helphelp.txt".)


Best regards,
Tony.
--
You will lose your present job and have to become a door to door
mayonnaise salesman.

--
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: