I'm having a problem when writing to a file created by another user. When I try to do :w
I get the error message E506: Can't write to backup file (add ! to override)
and when I do :w!
the file get's written but I still see this:
/share/home/file.txt" 161L, 9896C written
E207: Can't delete backup file
:se backup?
returns nobackup
. The privileges of thefile are -rwxrwxrwx
This happens in neovim NVIM v0.5.0-445-gca02db1f9
. If I try it with an older nvim like NVIM v0.2.2
it writes without any error just using :w
.
Edit: more settings:
backupcopy=auto
backupdir=.,~/.local/share/nvim/backup
set writebackup?
seems empty
:h E207
and:set writebackup?
– Matt Jun 3 '20 at 10:59:set writebackup?
returns ` writebackup` I'm not sure what that means the variable is set to; is it unset? – Moberg Jun 9 '20 at 12:57nobackup
). This is a security feature described in:h E207
. It seems you don't have the necessary permissions to delete the backup file. – Ralf Jun 11 '20 at 7:21set backupdir?
returnsbackupdir=.,~/.local/share/nvim/backup
Where can I find the backup file that you are referring to @Ralf? – Moberg Jun 11 '20 at 9:46strace
that might help to understand what Vim is doing exactly. Something likestrace -o trace nvim file
. After exit check the filetrace
and search forunlink
(= delete file). – Ralf Jun 13 '20 at 4:32