Title here
Summary here
Close the file and all of it evaporates — the tree, the timestamps, the branches. Reopen and Vim has no memory of any of it.
Unless you tell it to keep them.
set undofile
set undodir=~/.vim/undodirundofile — write the undo history to disk on every saveundodir — keep those history files in one folder instead of scattering them next to your sourceVim will not create it for you. From inside the editor:
:!mkdir -p ~/.vim/undodirEdit a file, save, quit. Open it again in a brand new Vim and press u — the change undoes. Vim reports 1 more line; before #1 26 seconds ago.
Close your laptop, come back tomorrow, and still walk backwards through everything you did. Two lines of config.