Re:Resolving the Great Undo-Redo Quandary
by gpvos on Friday November 11, 2022 @09:21AM
(#33561104)
And it is exactly why I find Emacs undo so hard to work with. But maybe I will get it now I've read this article.
[ Parent
| on HN ]
You can, if you like, install the 'vundo' package, which gives you a tree-based overview of your undo history, making it easy to switch between branches and go backward and forward. It's basically like the undo-tree view for the default undo mechanism.
Re:Resolving the Great Undo-Redo Quandary
by b3morales on Friday November 11, 2022 @01:02PM
(#33564287)
Two suggestions that might make it easier for you. There's a package called `undo-fu` that puts a thin layer on top of the undo system to keep the behavior strictly linear.
And built in, there are the `undo-only` and `undo-redo` commands. Unlike the base `undo` they will only walk in one direction.
Re:Resolving the Great Undo-Redo Quandary
by BeetleB on Friday November 11, 2022 @01:11PM
(#33564438)
Note that Emacs undo is not tree based, but works as described in the article. The tree based undo is a separate package one has to install.
As I wrote.
Re:Resolving the Great Undo-Redo Quandary
by jonathannerat on Friday November 11, 2022 @02:18PM
(#33565375)
See `:h undo-persistance` for that feature. In particular you want to do `set undofile` in your vim config
I'm not sure how you deduced that I'm actually a vi user, but it's interesting to see that vim has similar support but using separate linear undo and redo commands g- and g+ . undo-persistance and undofile seem to be orthogonal to that though, I'm even less sure why you're bringing that up.