by Izkata · 4y ago · 0 comments
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.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!
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...)
" https://vi.stackexchange.com/questions/6/how-can-i-use-the-undofile
if !isdirectory($HOME."/.vim")
call mkdir($HOME."/.vim", "", 0770)
endif
if !isdirectory($HOME."/.vim/undo-dir")
call mkdir($HOME."/.vim/undo-dir", "", 0700)
endif
set undodir=~/.vim/undo-dir
set undofileThank you!
I use https://github.com/mbbill/undotree but if that's not to your taste there are many others.
Edit: Screenshot (with an unusually blue Emacs theme): https://www.emacswiki.org/emacs/UndoTree#h5o-5
Because yeah, vim won't beat IntelliJ, but you can get it to be pretty decent with LSP: