For example, I have a working code but not fast enough, so I want to record this version of the code and ten continue to optimize it, and maybe got a better version, then record this version again, so on.
If I eventually failed to get a fast code, I want to roll back to the original working code.
I guess this could be achieved by using undo branch, but I didn't find how to do it.
Use a version control system. I recommend Git + Fugitive.
Seriously!
You won't look back.
Yes, you can add undo branches functionality that makes it more like a version control system.
In vim 7.3 you can have persistent undo, as described here, you only need to add the following lines to your .vimrc
.
set undodir=~/.vim/undodir
set undofile
To get the most of undo branches I highly recommend gundo since you can use it to visualize the tree and see the diffs of the commits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With