Feature request: Search through undo history
I have found myself in this situation many times.
It would be awesome to be able to search through the undo history to find exactly where a particular string of text was added/removed.
Looks like it should be vim rather than undotree who provide this kind of ability because the undotree is just a 'better user interface' for the cumbersome VIM commands and all the undo/redo data is maintained by VIM internally. What I could think of is a simple workaround like this // pseudo code loop until undo is not available { search "the string" undo one step. } map the script to something like a command or hotkey and it should do the job. It can even work without undotree.vim, but if you leave the undotree open, it will update itself according to the main content.
I think this would be a nice feature. I've been in some situations were this would be helpful. I agree that the workaround proposed by @mbbill is probably the only solution. The integration with the plugin would allow to highlight all the previous versions containing the string on the undotree window (maybe using :match Visual /pat/).
+1. I've asked about this before (http://vi.stackexchange.com/q/2220/1060 has links to both a SuperUser.com question and a Gundo feature request). I may switch to undotree from Gundo anyway, but if this were implemented I'd switch immediately.
Mundo has this feature but it requires Python like Gundo.
I'm think of a major refactor for Vim8 and NeoVim to take advantage of the async jobs. Maybe this feature can be implemented too. But it's not happening soon because I'm pretty busy now :(.
yes please! any news on this?
I think this would be a very useful feature as well. It's supported natively by Mundo.
The problem with the solution provided above is that stepping through the changesets in the history modifies the buffer, and in itself changes the history even as we are searching it. Which is really not nice.
Conceptually, to me this feature belongs in the domain of the extended undo interface rather than being done in Vim. The whole purpose of the undo extension is to abstract out the change history and operate/navigate it in better ways. Searching for a particular undo/change is part of that.
Implemented a working but slow version of search. check out this branch https://github.com/mbbill/undotree/tree/search
Nice! It works fine enough for me :) THANKS!