简体   繁体   中英

Cannot set swap, backup, and viminfo in vimrc (win64)

Folks: I have searched stackoverflow and other databases for the answer to this. I thought that a number of threads would have resolved it by now, but without luck.

I have attempted to set all three of these parameters using

set dir = c:\\tmp
set bdir = c:\\tmp
set viminfo +=nc:\\tmp\\viminfo

I thought that perhaps the name of the file was incorrect. I tried them in a newly created vimrc, _vimrc, and .vimrc (+ gvimrc...) in my $VIM (I don't want any of these files in the working directory, or in $HOME). These attempts did not work-- checking settings showed that after starting vim after these vimrc changes were made did not affect the settings.

Any help would be greatly appreciated.

Remove the spaces around the equals sign. The spaces are not part of the syntax for set and set thinks you are sending in 3 parameters instead of one.

The commands below should work.

set dir=c:\\tmp
set bdir=c:\\tmp
set viminfo+=nc:\\tmp\\viminfo

Also the proper place for these commands are in your vimrc file which would be located at $HOME/_vimrc

I used to use something like this which worked well:

set backup
set backupdir=$VIMRUNTIME/temp//
set directory=$VIMRUNTIME/temp//

Try forward slashes?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM