I've looked up and tried several of the following post up here regarding setting up persistent undo history in vim, but still I'm not able to do so. (macOSX Mojave)
here are some info:
:version
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
vimrc file = ~/.vim/.vimrc
":highlight Normal ctermfg=grey ctermbg=darkblue
:let $MYVIMRC="~/.vim/.vimrc"
set undofile
set undodir=/Users/dave/.vim/undodir
let mapleader = "\<Space>"
:nnoremap <leader>sv :source $MYVIMRC<cr>
:nnoremap <leader>ev :vsplit $MYVIMRC<cr>
~/.bash_profile
alias vim="vim -S ~/.vim/.vimrc"
Inside of /undodir:
%Users%dave%.vim%.vimrc %Users%dave%test.js
However when I load "test.js" and press u, vim responds with "already oldest change".
~/.vim/.vimrc
to~/.vim/vimrc
.