Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retain undo buffer after quitting VIM?

Tags:

vim

I'm wondering if it is possible to retain VIM's undo buffer after quitting.

For example, I'd like to make some edits to a file, save & quit (:wq), then reopen the file and still be able to hit 'u' to undo the edits. Is this possible in VIM?

like image 862
birdFEEDER Avatar asked Nov 11 '09 15:11

birdFEEDER


2 Answers

That isn't currently possible. There is an item in the TODO list and there was a proposed patch on the development mailing list, though.


Updated 2010/6/6: The pre-release work on Vim 7.3 has included the persistent undo patch.

like image 77
jamessan Avatar answered Oct 08 '22 02:10

jamessan


You probably already know it, but in most cases you can just save, then Ctrl-Z to go to the shell, and then fg to return to vim.

like image 40
Jacob Rask Avatar answered Oct 08 '22 03:10

Jacob Rask