Vim error E510: Can't make backup file (add ! to override)

淺唱寂寞╮ 提交于 2019-12-21 03:32:39

问题


I am using Vim on Windows and decided to create a separate directory for all my backup files created by vim.

I am using Vim from my command prompt and not using the vim GUI(gVim).

I looked at this post and added the following lines in my _vimrc

set backup
set backupdir = D:\\VimTemp

I have already created D:\VimTemp on my system.

Now whenever I try to save changes to my file using :w I get the following error message

"PenProperties.py" E510: Can't make backup file (add ! to override)

I have already tried setting the backupdir in the following ways:

  • set backupdir = D:\\VimTemp

  • set backupdir = "D:\\VimTemp"

  • set backupdir = "D:\\VimTemp\\"

  • set backupdir = "D:\VimTemp"

Now, I have already looked at similar questions on stackoverflow but the problem is still there.

So, my question is how to make this work properly.


回答1:


Kill the spaces around =

set backupdir=D:\\VimTemp

should work if you've created the directory.




回答2:


On Linux, you can do by setting in editor- :verbose set backupdir?



来源:https://stackoverflow.com/questions/10664805/vim-error-e510-cant-make-backup-file-add-to-override

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!