Cannot create backup file(add ! to overwrite) Cannot create backup file(add ! to overwrite) bash bash

Cannot create backup file(add ! to overwrite)


You can, as vi (or, more likely, vim) is saying force a write by doing:

:w!

Alternatively, write the file to an alternative location:

:w! /path/to/other/location

To check where your backup files are being written (normally):

:se backup? backupdir? backupext? 

Try to touch a file in that directory and see if your Operating System gives you an error to enlighten you as to why your editor cannot write there.


Had the same problem. Tried all options as above but it did not work. Then when I checked my disk space, it was full. Once I cleared some space then I was able to write back to file again.
P.S: This was in linux.


Had the same problem. It was because I installed vimconf as root. You need to change rights of files in ~/.vim directory and change owner to your user.

sudo chmod 0750 ~/.vimsudo chown user ~/.vim