Live data from Hacker News

Resolving the great undo-redo quandary

github.com

171–180 of 247 posts

Re: Resolving the great undo-redo quandary

#171
post #165
post #153

Earlier quoted context omitted.

Wait until you see what intellij can do. It can do that, while also layering it in a logical, graphical diff viewer

Vim has plugins for that. ;) I use https://github.com/mbbill/undotree but if that's not to your taste there are many others. e.g. https://docs.stevelosh.com/gundo.vim/

I rarely have to use it, but Undotree is so amazing when you need it.

Re: Resolving the great undo-redo quandary

#172
post #26

This is exactly how undo works in Emacs out of the box. Personally, I prefer to install the undo-tree package and manually browse through the tree of undo paths. I'm not sure why this author finds a tree unacceptable for this purpose.

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.

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.

Re: Resolving the great undo-redo quandary

#173

Earlier quoted context omitted.

Wait until you say this after 10 years.

After 10 years he might even be as fast as with a non-modal editor.

Every non-modal editor I’ve used is significantly slower at editing text than Vim

Re: Resolving the great undo-redo quandary

#174

This is exactly how undo works in Emacs out of the box. Personally, I prefer to install the undo-tree package and manually browse through the tree of undo paths. I'm not sure why this author finds a tree unacceptable for this purpose.

Yeah, I spent a long while (years) using pretty much exactly the solution he describes, as implemented in emacs. It's not as good as a tree, because undo/redo cycles make it very annoying to traverse through the history. I greatly prefer undo-tree.

Re: Resolving the great undo-redo quandary

#175
post #102

Vim has this, it's :earlier and :later https://vimtricks.com/p/vimtrick-time-travel-in-vim/ :earlier 3 – Undo the last 3 changes :earlier 5m – Go back to the state of the file 5 minutes ago :later 2 – After undoing something, redo the next 2 changes :later 1h – Travel forward through the change history 1 hour Vim also stores the tree of changes, but it's a pain to access without plugins.

I think what vim has is different and better than what OP describes - it's two separate change logs, one for undo/redo and one for time-based jumping. Trying to fit both of those constructs into one list gets messy.

Re: Resolving the great undo-redo quandary

#176
post #32

This is exactly how undo works in Emacs out of the box. Personally, I prefer to install the undo-tree package and manually browse through the tree of undo paths. I'm not sure why this author finds a tree unacceptable for this purpose.

He literally says why at the top of the post. People find it too complicated.

No they don’t. The method they are praising is already the base implementation for emacs.

Re: Resolving the great undo-redo quandary

#177
post #153
post #102

Vim has this, it's :earlier and :later https://vimtricks.com/p/vimtrick-time-travel-in-vim/ :earlier 3 – Undo the last 3 changes :earlier 5m – Go back to the state of the file 5 minutes ago :later 2 – After undoing something, redo the next 2 changes :later 1h – Travel forward through the change history 1 hour Vim also stores the tree of changes, but it's a pain to access without plugins.

Wait until you see what intellij can do. It can do that, while also layering it in a logical, graphical diff viewer

https://www.jetbrains.com/help/idea/local-history.html

Re: Resolving the great undo-redo quandary

#178
post #142

Earlier quoted context omitted.

It doesn’t sound like you have a problem though. Just keep doing what you’re doing.

Hehe, sure, but there are better ways to do this, and it’s a common need. If the best thing we have is hitting undo 45 times to find something, copy it, try not to accidentally type anything and try not to accidentally lose the clipboard, then redo 45 times, then do a bunch of manual editing… now repeat the entire process for every file, when there are several involved… if that’s sufficient, then SVN is sufficient fo…

In the proposed article, it sounds like if you accidentally typed anything you would have to hit "undo" twice instead of "redo" N times to get back. Still seems confusing.

Re: Resolving the great undo-redo quandary

#179

Earlier quoted context omitted.

What a great feature! Is the author of that feature here? If so, I want to know how they could develop such a feature and be so quiet about it. It's like someone baking a birthday cake and then dropping it down an abandoned well. Just imagine how much more productive we'd all be if Vim bros were as loud as the crypto bros over the past decade!

It's at least 16 years old https://github.com/vim/vim/blob/1f4d4de1ba52d0a9f1310e1026d9...

And in that 16 years, where was the Vim-sponsored nascar with ":earlier 39" printed on the hood in Courier New?

Shameful.

(I'm actually afraid to continue making jokes on the non-zero probability that someone here reads this and tries to start a Vimcoin...)

Re: Resolving the great undo-redo quandary

#180
post #102

Vim has this, it's :earlier and :later https://vimtricks.com/p/vimtrick-time-travel-in-vim/ :earlier 3 – Undo the last 3 changes :earlier 5m – Go back to the state of the file 5 minutes ago :later 2 – After undoing something, redo the next 2 changes :later 1h – Travel forward through the change history 1 hour Vim also stores the tree of changes, but it's a pain to access without plugins.

Came here to look for comments about VIM's `g-` and `g+` feature, was not disappointed :)

Are those the shortcuts for it? I can't believe I didn't realise vim had this.
Post reply on HN