I am trying to use persistent undo with vim 7.4.9
In my vimrc, I have:
set undodir=/home/myname/.vim/undo//
set undofile
set undolevels=1000
set undoreload=10000
of course, /home/myname/.vim/undo directory exists.
I have opened a few files with vim and made a few changes.
I see undofiles created in /home/myname/.vim/undo/:
$ ll /home/myname/.vim/undo/
total 23K
-rw-r--r-- 1 hpcpcollab hpcpcollab 523 18 sept. 11:23 %home%myname%foo
-rw-r--r-- 1 hpcpcollab hpcpcollab 14K 18 sept. 11:03 %home%myname%bar
-rw-r--r-- 1 hpcpcollab hpcpcollab 2,2K 18 sept. 11:52 %home%myname%test
However, when I close these files, reopen them, and press 'u' in order to undo, vim replies: "Already at oldest change".
What am I missing?
Thx
Julien
Could patch 7.4.24 perhaps fix your problem?
In any case, try explicitly reading the undofile using :verbose :rundo ~/.vim/undo/undofile
and see what error Vim reports. This should help localize the problem, why vim doesn't use the undofile.
I have the exact same configuration except for the //
at the end of your undodir
definition. Try to remove those. You can also try the :undolist
command to see if vim actually read something.
May I suggest you use the Gundo
plugin to manage your undo tree ? It is one of the most powerful plugin I am using, and it offers a lot of features to manage undo / redo in vim.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With