Vim error E510: Can't make backup file (add ! to override)
Kill the spaces around =
set backupdir=D:\\VimTemp
should work if you've created the directory.
Related videos on Youtube
RanRag
I am an undergraduate student who has completed his B-Tech in Information & Communication Technology(ICT), INDIA. I am just a normal guy who has recently found interest in programming. Initially I was a big Java fan but now I am a Python enthusiast. Currently, exploring Android App Development.
Updated on September 15, 2022Comments
-
RanRag over 1 year
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.
-
-
pb2q almost 12 yearsalso: don't neglect the help command for vim problems --> :help backupdir
-
RanRag almost 12 yearsNice. It Worked. Thanks a lot man and yes from next time I will first look at
vim help
. -
pb2q almost 10 years@SJMP what platform are you running gvim in? The above uses windows-specific path naming conventions, so if you're running under linux/OSX then you'll need to adjust the command to point to the actual directory that you're trying to use. Also note that the command assumes the existence of the directory VimTemp on the D drive: If you're in windows, have you created that directory?
-
Sagar Jain almost 10 yearsI am running on Windows. I got it now. Thank you :-)
-
nurettin over 6 yearsMy problem was that I used single slash character for paths.