How do I enable persistent undo so undo history survives closing files?
:set undofile undodir=~/.vim/undodir
By default, Vim's undo history is lost when you close a file.
:set undofile undodir=~/.vim/undodir
By default, Vim's undo history is lost when you close a file.
set undofile undodir=~/.vim/undo//
Enable undofile and set undodir to persist undo history to disk.