Is it possible to tell vim to save its viminfo file somewhere else? Such as in the .vim folder
They are not the same. The vimrc is the file you edit to change vim's behavior. It is a the configuration file. The viminfo is like a cache, to store cut buffers persistently, and other things.
You can set viminfo by temporary and permanent way: For temporary way, you can input the setting command by :set viminfo=xxxx. For permanent way, you can input the setting in your ~/. vimrc in Linux and $VIM/_vimrc in Windows.
Vim's user-specific configuration file is located in the home directory: ~/. vimrc , and Vim files of current user are located inside ~/. vim/ . The global configuration file is located at /etc/vimrc .
Try adding set viminfo+=n~/.vim/viminfo
to your ~/.vimrc
file. From :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.
set viminfo='1000,nc:\\users\\abcdef\\_viminfo
This works for me in Windows 7.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With