简体   繁体   English

无法在vimrc(win64)中设置交换,备份和viminfo

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

Folks: I have searched stackoverflow and other databases for the answer to this. 伙计们:我已经在stackoverflow和其他数据库中搜索了答案。 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). 我在$ VIM中的新创建的vimrc,_vimrc和.vimrc(+ gvimrc ...)中尝试了它们(我不希望在工作目录或$ HOME中找到任何这些文件)。 These attempts did not work-- checking settings showed that after starting vim after these vimrc changes were made did not affect the settings. 这些尝试不起作用-检查设置表明在进行这些vimrc更改后启动vim之后不影响设置。

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. 空格不是set语法的一部分,set认为您要发送3个参数而不是一个。

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 这些命令的正确位置也在vimrc文件中,该文件位于$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? 尝试正斜杠?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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