Monday, August 1, 2011

Re: swap files reverting my work erroneously

Reply to message «Re: swap files reverting my work erroneously»,
sent 08:20:31 02 August 2011, Tuesday
by Gary Johnson:

> The trouble with
> continually saving, though, is that you lose your reference for the
> changes you've made to the file since you started editing. That's
> not always important, but sometimes it's very handy. And having
> swap files means I can do that without worry.
Was not this solved by persistent undo introduced in vim-7.3?

Original message:
> On 2011-08-02, ZyX wrote:
> > Reply to message «Re: swap files reverting my work erroneously»,
> > sent 04:27:35 02 August 2011, Tuesday
> >
> > by Gary Johnson:
> > > will tell you that it has found a swap file, etc. Regardless of you
> > > choice, Vim will use a new swap file for the current buffer, named
> > > .foo.swo. That file will be deleted at the end of your Vim session
> > > if you exit normally. The swap file from your previous Vim session,
> > > .foo.swp, will remain. That's the one you have to delete manually.
> >
> > It is false: if I choose to delete swap file (in the vim prompt, not from
> > shell) it will use .foo.swp, not .foo.swo.
>
> I stand corrected. Thanks.
>
> > > > I think noswapfile will checked into my env repo. When you have 30+
> > > > buffers open, this is not very useful to me.
> > >
> > > I think that is a bad idea. Vim creates swap files to protect your
> > > data. They only persist after Vim has crashed, which is a good
> > > thing. Once you have decided to use their contents after a crash,
> > > or not, you can delete them and not be bothered with them until the
> > > next time Vim crashes.
> >
> > I have swap files to prevent myself from editing one file in two vim
> > instances simultaneously. Though sometimes something goes wrong and vim
> > or the whole system crashes, but I never needed them to recover
> > anything. All you need to have the same behavior is to train yourself to
> > do «paused for thinking - hit {lhs of your mapping to :up} to save
> > file». For me it happens even more times then «stopped inserting - exit
> > insert mode».
>
> That's another good reason to use swap files. The trouble with
> continually saving, though, is that you lose your reference for the
> changes you've made to the file since you started editing. That's
> not always important, but sometimes it's very handy. And having
> swap files means I can do that without worry.
>
> Regards,
> Gary

No comments:

Post a Comment