I'm trying to move my .viminfo
file into my .vim/
folder for cleaner syncing across multiple machines. (I have my .vim
stored on Dropbox, and then create symlinks to it from my home directory.)
So this morning, I found this answer on how to do just that. Great! Unfortunately, I use Windows at work and Mac at home, so ~/.vim
is actually sometimes ~/vimfiles
. As a result, a one-line solution
set viminfo+=n~/.vim/viminfo
has now become a 5-line solution
if has('unix')
set viminfo+=n~/.vim/viminfo
elseif has('win32')
set viminfo+=n~/vimfiles/viminfo
endif
which just feels clumsy to me.
Is there some kind of default environment variable I can use to access the user-specific runtime path, à la $VIMRUNTIME
or $MYVIMRC
? Or is this something I just have to dance around?