4 ms·
I use '" (tick, double quote) all the time, after exiting and coming back into a file it jumps back to where I was. Time travel in vim is insanely cool. ":ear
by linsomniac 3y ago
I use '" (tick, double quote) all the time, after exiting and coming back into a file it jumps back to where I was.
Time travel in vim is insanely cool. ":earlier 5m" undoes changes to the buffer to make it like it was 5 minutes ago. ":later 1m" will travel the other direction.
Also useful in undo/redo is "g-" and "g+" which undo and redo non-linearly. With just "u" and "^r" you can get to where some undo states are reachable, g-/g+ can get you to those missing states.
- hirundo 3y agoDoctor Strange did a specific kind of time travel in a Marvel movie that I want in vim. He did it to an apple, but not the surrounding area. I would like to be able to highlight a selection in vim and just do time travel in that part, so that my changes elsewhere are not reverted. Does that exist?
- phyrex 3y agoIt exists in emacs. Blew my mind when I first saw it!
- satvikpendem 3y agoWhat's the feature called?
- phyrex 3y agoApparently “selective undo”: https://www.gnu.org/software/emacs/manual/html_node/emacs/Undo.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Un...
- satvikpendem 3y agoI've been looking for this in a code editor for so long. I just want to undo inside a specific set of lines, is that so hard?
- phyrex 3y agoRight? Ever since I learned it exists in emacs I’ve been frustrated that this isn’t the top priority in every other editor!