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

Re: Wish: Vim remembered my previous changes (so that I could und o them)

Expand Messages
  • Andrew Pimlott
    ... What do you mean by this one? The first way I read this is unrelated to saving the undo buffer: you save, you edit, and you hit a key to take you back
    Message 1 of 5 , May 30, 2003
    • 0 Attachment
      On Fri, May 30, 2003 at 11:39:30PM +0200, Bram Moolenaar wrote:
      > I'm interested as well. The implementation is one thing (esp. checking
      > that the original file didn't change, otherwise you end up with
      > garbage). The user interface is another. There probably should be
      > command to undo/redo up to a point where the file was saved.

      What do you mean by this one? The first way I read this is
      unrelated to saving the undo buffer: you save, you edit, and you hit
      a key to take you back through the undo list to the point of the
      save. Actually, I would like this feature. I would also like a key
      to go to the ends of the undo buffer--I often do 1000u to get back
      to where I started--then look around _very carefully_[1] so I don't
      accidentally edit anything--then 1000^R. Now that I think about it,
      a way to set marks in the undo list would be nice ...

      > Or "undo
      > for 10 days"... And "delete undo info older than a week"...

      I would love it.

      > remember multiple change branches. Storing the info isn't difficult at
      > all (just a few extra pointers). The big question is how the user could
      > navigate through the branches. Try thinking of a nice solution for
      > that!

      I remember this from the vim 6 idea vote, and I've always thought it
      would be cool--but I also didn't have any clue about the interface.
      However, writing this message gives me an idea: What about marks in
      the undo list--er, tree? So I make some changes, have second
      thoughts, set an undo mark, undo my way back to a starting point,
      and make some more changes. If I jump to the undo mark, I get back
      to my first changes, and can undo and redo just as before. Ie, u
      and ^R always work linearly, but I can switch between streams. This
      also controls the memory usage: if you abandon a branch without
      setting any marks, vim can throw it away.

      Wow, I really like this idea. I'm beginning to think this could
      change the way I edit. (Just like 'hidden' did, by allowing me to
      keep undo lists for every file I edit in a session. Maybe I'm just
      an undo junkie.)

      Andrew

      [1] Does anyone remember the point in Zork where you must "crawl
      carefully"--not "crawl"--to get past some obstacle?
    Your message has been successfully submitted and would be delivered to recipients shortly.