Open MyMyrtle opened 4 years ago
AFAIK VIM's undo file (in this case the one under you .vim/tmp/undo/ folder) doesn't store all the file contents for each undo version, instead it saves the diff, which means you need the original file as the base version in order to go back to any of the history versions. So I'm sorry you lost your file, but it seems like there isn't much you can do for it. However, if you happen to have a swap file, you might be able to restore it.
However, if you happen to have a swap file, you might be able to restore it.
I creat a wiki page with vimwiki, and there is a :
in the name such as 20240322foo10:00bar.md
.
Vimwiki can create, edit and save this page. And this page can be reopened with the same name after closing Vim.
However, I found that the page file is actually saved as short name 20240322foo10
on the disk and the file size is 0.
And undotree work fine with the full name 20240322foo10%00bar.md
.
Because I discovered the problem later, I deleted those zero-size files. Fortunately, I have backups of these files. However, when I put the backup files back and Vimwiki opens them with the original full names, the content is blank, and I can't use undotree either.
Is there any way to restore the files in this situation?
tbh I'm not exactly sure what's happening here. I guess you might have hit some weird rare edge case bugs or something.
Hi,
I have deleted a file which I would like to restore. I can see the undo file is still there, for example:
Of course when I try to open
/etc/sysctl.conf
it is empty and no undo tree is visible in vim. Even tryingrundo ls .vim/tmp/undo/%etc%sysctl.conf
says "File contents changed, cannot use undo info". Is there any option to recover it with the undo info?I love undotree!!
Best