I just switched from VIM to sublime text 2. I LOVED my vim, but st2 is a great editor too. I think the only MUST HAVE missing feature is the undo tree, and a way to visualize/manipulate the tree. Something like this: sjl.bitbucket.org/gundo.vim/
Undo Tree Implementation and Visualization
you could do it as a plugin by overriding the undo
/redo
commands (via on_text_command
—“Called when a text command is issued. The listener may return a (command, arguments) tuple to rewrite the command, or None to run the command unmodified.”) and having an own stack/tree. then your plugin can of course also visualize this tree
You bring up a great point here.
Hopefully soon someone will implement “Gundo for ST”. I hope it won’t be me, but if this goes on for another year it might actually be me.
I’ve messed around with hooking the undo command and utilizing view.command_history before and my experiences weren’t too great. I honestly would prefer this to be implemented as a core feature.
Me as well! This is such an excellent feature I would be willing to “chip in” to pay someone to make a high quality extension like Gundo!
Update: The bitbucket site seems to be down.
A mirror can be found on: https://github.com/sjl/gundo.vim
and a Screenr: http://www.screenr.com/M9l
Another bump!
@valerij_ I re-read your recommendation. Do you know of any plugins that do something similar that could be used a starting point?
(Note: My strategy from now on is to bump every time I need this feature in real life, with a minimum bump-interval of two weeks)
@diego898 I doubt this is coming any time soon because of quite little return on investment. The feature being requested is quite complicated and there isn’t exactly a big demand for it.
You could try working on a plugin to do this, though. You could make use of Vcs to handle multiple branches etc.
not really.
per se, this wont be that much of a hassle, just create a tree structure, have an (git like) HEAD
where you append new states. The only thing i dont really know is how to hook existing functionality which pushes states to the undo stack, but i guess one could just hook all edit events and push that. The developer of Braid had a good talk about how to have a lot of undo information while not utilizing a ton of memory, those ideas would be useful here.
as for visualization, i would copy the code from git to layout and draw the tree in ascii.
as @FichteFoll said, you could even try using a in-memory VCS, maybe dulwich can be hacked that way
Just a note here that such a package has been developed and added to Package Control:
Sublundo: Vim-like persistent, branching undo