Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I make an edit to a file and then leave vim, I would like to be able to undo that change when I reopen it later.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You can turn on persistent undo, check the help with

:help undo-persistence

At least vim 7.3 is required.

undo-persistence needs some setup before use, like defining a directory to keep the persistent undo information. A good explanation is given here: http://amix.dk/blog/post/19548 (thanks to @Dalker)

share|improve this answer
    
Thanks a ton! :) –  hek2mgl Mar 13 at 22:03

I can't comment on the post above, but I'd like to point out that undo-persistence is not available in vim 7.2, which is the version installed by default in Ubuntu 10.10, so probably in many people's computers at the time of this post.

Once vim is upgraded to 7.3, undo-persistence needs some setup before use, like defining a direcory to keep the persistent undo information. A good explanation is given here: http://amix.dk/blog/post/19548

share|improve this answer
    
I concur, I'll edit my answer. –  rpilkey May 11 '11 at 17:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.