Persistent undo

13 views
Skip to first unread message

Marco Guidetti

unread,
Nov 10, 2011, 7:41:57 AM11/10/11
to vim...@googlegroups.com
Hi all!

I am not able to get persistent undo working.
In my .vimrc I have this:
[...]
"persistent undo:
set undofile
"in the right directory
set undodir="~/.vim/undo"
[...]
(the directory ~/.vim/undo exists and is readable and writable).

I also use the Gundo plugin
(http://www.vim.org/scripts/script.php?script_id=3304) and pathogen.

I would expect, when closing and reopening a file, to be able to see
the undo tree of all sessions on the same file inside gundo's window,
but I can't.
I am probably missing something or doing something wrong, can someone help?

Thank you,

marco

Christian Brabandt

unread,
Nov 10, 2011, 3:06:58 PM11/10/11
to vim...@googlegroups.com
Hi Marco!

Actually persistent undo should just work. What happens, if you enter:

:exe "verbose :rundo" undofile(@%)

regards,
Christian

Ben Fritz

unread,
Nov 10, 2011, 3:08:13 PM11/10/11
to vim_use


On Nov 10, 6:41 am, Marco Guidetti <ma...@marcoguidetti.org> wrote:
> Hi all!
>
> I am not able to get persistent undo working.
> In my .vimrc I have this:
> [...]
> "persistent undo:
> set undofile
> "in the right directory
> set undodir="~/.vim/undo"
> [...]
> (the directory ~/.vim/undo exists and is readable and writable).
>
> I also use the Gundo plugin
> (http://www.vim.org/scripts/script.php?script_id=3304) and pathogen.
>

I have a very similar setup, though I don't use pathogen, and my undo
directory is ~/.vimundo. Works great for me!

> I would expect, when closing and reopening a file, to be able to see
> the undo tree of all sessions on the same file inside gundo's window,
> but I can't.
> I am probably missing something or doing something wrong, can someone help?
>

Maybe your 'undolevels' option is set poorly?

Andy Wokula

unread,
Nov 10, 2011, 5:39:47 PM11/10/11
to vim...@googlegroups.com
Am 10.11.2011 13:41, schrieb Marco Guidetti:
> set undodir="~/.vim/undo"

The double quotes should not be there (they start a comment)
:set undodir=~/.vim/undo

--
Andy

Ivan S. Freitas

unread,
Nov 10, 2011, 7:45:03 PM11/10/11
to vim...@googlegroups.com
> The double quotes should not be there (they start a comment)
>    :set undodir=~/.vim/undo

Also, make sure that the directory exists.

--
Ivan Sichmann Freitas
GNU/Linux user #509059

Marco Guidetti

unread,
Nov 11, 2011, 3:55:04 AM11/11/11
to vim...@googlegroups.com

Hi,

thank you all.
This appeared to solve the problem and, as someone said, just works. :)

Thanks,

marco

Reply all
Reply to author
Forward
0 new messages