Is there a way to rename/copy/move a file and maintain the vim persistent undo information?
If I do
I can't hit u to undo.
Already at oldest change :-(
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
:saveas keeps the undo history intact.
:saveas is equivalent to the combination of
:w newname followed by
:e #. I usually find it more handy than the
:e, especially since with
:saveas it's not really possible to forget about doing the second command and end up editing the first file. (Which you can guess is something I've done more than once!)
Tim Pope created eunuch plugin with such feature. It has
:Rename commands. Do not know if it works under Windows since description is about UNIX shell commands, can't test it right now. Also as filbranden said you can copy with