We can use the u
, <C-R>
to undo/redo in Vim and it provides a lot of features to manage the undo tree.
But sometimes, I make a change (let say on line 1) and I go do some other changes on another line.
When I come back to line 1, I may think that the previous value of this line was better.
My current workflow is:
- undo until I get the value back
- yank the line
- redo until the top of the undo tree
- replace the line.
I think this clearly can be improved, but do you know if there is a vim feature that provide an history of changes for each line?
:changes
- the most recent value on the 2nd column that matches the line number you want to redo has a change number (1st column) associated with it, that can be used as a count tog;
(add one to that count number).