Loading ...
Sorry, an error occurred while loading the content.

125115Re: swap files reverting my work erroneously

Expand Messages
  • Gary Johnson
    Aug 2, 2011
      On 2011-08-02, Tony Mechelynck wrote:
      > On 2011-08-02, Gary Johnson wrote:
      >> On 02/08/11 06:38, ZyX wrote:

      > >>>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
      >
      > If you need a snapshot of a certain state of the disk file, take a copy.
      > If you need successive snapshots, use numbered or dated backups, Vim
      > supports them, after a fashion: see ":help backupext".

      Yes, I _can_ do that, and I do that on occasion, but I don't
      _have_ to do that to have a reliable copy of the original state of
      the file and of my changes. Not doing that, I don't have to deal
      with the clutter of backup copies that need to be deleted at some
      point. For long-term backup and history retention, I use a VCS.

      > I'm sure I'm not the only one on these lists who started editing at a
      > time (and with an editor) where such luxuries as automatically recorded
      > swapfiles simply didn't exist: for us old-timers, it has become a reflex
      > to save the files whenever we stop editing (even if it's just to take a
      > leak), and at least once every quarter-hour.

      I started using Unix and vi in 1985 in an environment where people
      would inadvertently unplug serial cables or coaxial LAN cables, and
      where occasional lightning strikes and careless backhoe operators
      would take out our power. I got in the habit of saving my work
      regularly.

      But now we have more reliable systems, and UPSs, and Vim with
      automatic backups. My habits have changed. Now I save a file when
      I'm done with a set of changes to it, not reflexively.

      Regards,
      Gary

      --
      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
    • Show all 25 messages in this topic