Questions tagged [undo-redo]
Question about navigation in the undo history, undoing, and redoing changes
95 questions
0 votes
1 answer
55 views
How to trigger a writting of undofiles on VimLeavePre?
I have a VimLeavePre autocmd, but it doesn't work as I intended. About the autocmd: i. On VimLeavePre, it will prompt for a location to store a Session.vim. ii. On getting such location, it tries to ...
0 votes
2 answers
77 views
How secure is an undofile?
There can be cases that one left some undo files here and there on some paths that may be also accessible by others. So how secure is an undofile? It seems that there is a checksum something to check ...
1 vote
2 answers
184 views
How to make undofiles work well with refactoring?
Vim provides udir for a centralized place for all undofiles, so I did set udir=UNDO, But I yet to know a way so that those undofiles can still work after refactoring. In my testing an undofile %Users%...
2 votes
1 answer
174 views
Can Neovim understand Vim undo files?
Is it possible for Neovim to understand vanilla Vim's undo (*~ & .*.un~) files? Even if I have vim.opt.undodir = vim.fn.expand("~/.config/nvim/undo") set in ~/.config/nvim/init.lua?
0 votes
0 answers
43 views
Can't find older versions of file, despite using undofile
I have this in my .vimrc " persistent undo even after closing if has('persistent_undo') if !isdirectory($HOME . '/.vim/backups') call mkdir($HOME . '/.vim/backups', 'p') endif set ...
0 votes
1 answer
103 views
Nvim API: edit a buffer without affecting the undo tree?
I'm wondering if this is possible, I tried searching for APIs and asking LLMs how to do so. This line of lua makes an edit but is in the undo tree: vim.api.nvim_buf_set_lines(vim.api....
1 vote
1 answer
104 views
Discard certain change from undolist
I usually want to delete empty spaces before the end of line, something than can be done easily with: :%s/\s\+$//g|'' But honestly I would like to do not include this change in the undolist, possibly ...
0 votes
1 answer
42 views
Save buffer version to register and restore buffer to specific version
I use the undo functionality via u all the time and redo less frequently. I just now noticed, however, that the status bar reports change numbers, or perhaps buffer version numbers. [No Name] [+] ...
1 vote
0 answers
129 views
Recover a complete file from an undo file and a backup copy
I use vim with auto backups and persistent undo. I just lost a file, and I want to recover as much of it as possible. The backup contains most of the lost file, but the most recent changes are missing....
2 votes
1 answer
96 views
Is there an option for setting undo files' extension, similar to the one for backups?
For backup files, there's the option backupext for changing the extension of backups from filename.ext~ to (for example) filename.ext.bak by using set backupext=.bak in a vimrc file. Is there a ...
2 votes
1 answer
160 views
U (undo line) doesn't work on single line buffer
I am working through the user manual, doing the examples on a Mac using Vim (comes bundled with MacVim) on the terminal and was doing fine with undo (Chapter 2). Then with undo line or U, when doing ...
1 vote
2 answers
359 views
Restore auto-loaded file that was lost by accidently undoing edits
I accidentally removed about 1 hour of my work, how to restore? Last week I worked with file.md on my current computer and didn't save it into disk but just put my OS into a sleep mode. Yesterday I ...
1 vote
0 answers
44 views
Unable to undo some symbolic links
I have the following symbolic link for my ~/.vimrc ~/.vimrc -> ~/Dropbox/Backup/Dotfiles/.vimrc When I edit this file with vim ~/.vimrc, I see an undofile is created which looks like this: %Users%...
1 vote
1 answer
160 views
How to merge the changes in undofile with the current version?
I use undotree to visualize the changes available in my undofile. Is it possible to merge a branch of the undofile with the current version of the file I am working on? I am looking for something ...
1 vote
1 answer
720 views
How to find the timestamp of changes in Vim?
I am aware of the undofiles in Vim but they are binary and I don't know how to read them. I tries strings but it didn't help for my purpose. I am also aware of the :changes command but that only gives ...