尝试将set viminfo = n〜/ .vim / viminfo添加到〜/ .vimrc文件中.来自:help’viminfo’:
n Name of the viminfo file. The name must immediately follow the 'n'. Must be the last one! If the "-i" argument was given when starting Vim,that file name overrides the one given here with 'viminfo'. Environment variables are expanded when opening the file,not when setting the option.