Is there way to prevent Vim from clearing history after exiting Vim?
undotree setting for this -
:h undodir and
I have it like so:
if has('persistent_undo') if exists('$SUDO_USER') " don't create root-owned files set noundofile else set undodir=~/.local/tmp/vim/undo// " keep undo files out of the way set undodir+=~/.vim/tmp/undo// set undodir+=. " actually use undo files set undofile endif endif
Despite the check for sudo user to not create a undo file owned by root, this sets few dirs for Vim to create undofile (first available will be used). Also this has
set undofile to make sure undofile will be used.
I just checked on some config file with UndoTree and there are changes made 11 days ago and I'm sure I did reboot my laptop in between at least 4 times.