Vim also has persistent undo. Check out the options:
undofile
undodir
These will cause vim to store all file histories into files within that directory. Now you can close and reopen vim and continue undoing as much as you want!
Re:Ten Years of Vim
by wildmusings on Monday May 21, 2018 @07:36AM
(#17117604)
Do you know if there’s a way to make “normal undo” stop at the beginning of the current session, then have some special command or confirmation that I indeed want to move further back? I almost never want to undo past the current session, but occasionally I do.
Re:Ten Years of Vim
by reitanqild on Monday May 21, 2018 @01:56AM
(#17116437)
FWIW Netbeans also keeps local file history. (Nothing against Jetbrains. They seem like a great company with great products and a really nice pricing model, I just prefer Netbeans.)
Re:Ten Years of Vim
by giancarlostoro on Monday May 21, 2018 @03:56AM
(#17116829)
After IntelliJ I prefer NetBeans to be fair. I like JetBrains due to all the IDE's they offer me with consistent capabilities between all of them.
Re:Ten Years of Vim
by williamxd3 on Sunday May 20, 2018 @11:41PM
(#17115981)
Did that too, I thought history wouldn't work cause the .idea folder inside was gone, but it did. JetBrains saved me some good 5 hours of work that day.
Re:Ten Years of Vim
by timrichard on Monday May 21, 2018 @06:41AM
(#17117382)
It's a great feature, and I use Local History a lot.
One thing to bear in mind, though, is that it will go if you invalidate caches.
Re:Ten Years of Vim
by some_account on Monday May 21, 2018 @01:11AM
(#17116264)
It has saved me too a couple of times. Jetbrains for the win :)
Funny you mention that though, a coworker opens files in vim and does changes and tests but keeps it open if he's going to try something else so he can always go back to those other changes (guessing he reverts the code, then opens yet another vim window). I work with a lot of VI(M) coders but they barely take full advantage of VI(M). I just use IDE's or Emacs / VS Code (w/ X Forwarding more recently) personally makes it easier to find the fancy features with a UI.
I'll share that time travel feature to my VIM coworkers maybe it'll save their tail sometime.