On Mon, Oct 16, 2006 at 02:31:40PM -0700, Max Dyckhoff wrote:
> I am almost certain that this has been asked before, and I am almost
> sure that the answer is "no, that would be silly", but I can't find
> anything in the archives, in :help or on Google in general. I am
> suffering the aftereffects of a bout of flu today, so perhaps I'm just
> being bad at searching.
> 
> Basically, is there any (easy) way of preserving the undo stack
> between sessions? I typically work with half a dozen tabs and 20-30
> files open at any one time and whenever I need to reboot my machine
> then I do a :mksession and reload it when I come back. It is
> ridiculously useful, but I would love if the undo was stored too.
> 
> Cheers, and sorry for asking this over-asked question again.
> 
> Max

     Have you tried saving the swap file?  While editing foo.txt, that
file would normally be .foo.txt.swp.  Normally, it is deleted when you
quit vim.  If you save and restore the swap file (and maybe also the
version of the file before you started editing it) then I think you will
be back where you started.

:help swap-file

Disclaimer:  I have not tried this myself, and you *really* want to test
this idea before using it on files that matter!

HTH                                     --Benji Fisher

Reply via email to