Vim will not write a file without a "!" sometimes (E13)

Very often (like several times per hour), when I save the file :w , vim tells me: "E13: The file exists (add! Override)"

Example

I don’t know why he does it, I can’t reproduce it reliably, he feels random.

This is my vimrc, note that it installs nobackup , nowritebackup and noswapfile , and there is a strip trailing whitespace function that runs when a file is saved.

In addition, I tend to open 20 virtual windows at once, all of which are based, often editing the same file. It’s also not unbelievable that I have the same buffer open in several windows (i.e :vsp ) and can open it and then open it again with the e command, perhaps from the relative path to the file, or maybe from absolute cmap %/ <CR>=expand("%:p:h")."/"<CR> ). I don’t know if that matters. The next time I have this problem, I will check my ls and report something strange.

Update:

When I tried to save "lib / seen_is_believing / wrap_expressions.rb" (note that this is a different file than the one in the gif), it happened again. Here is ss, this is buffer 3:

ls

Update2 (for @mMontu)

I just realized that there are two errors. The one in the screenshot is the thing just read. One in gif is more common, E13: File exists (add ! to override)

I just clicked E13 File exists , for this, readonly is not installed:

readonly is not set

Update 3

I'm sure the problem is with the ZoomWin plugin. I switched it to a newer version and it just didn't work. So I stopped using it a bit, and I did not have this problem. Then I switched it back, b / c I missed its functionality (this is my favorite vim plugin), and the problems started again. Perhaps this is ZoomWin in combination with the NerdTree window. Probably not the mistakes of the authors of lib, vim generally seems fragile and buggy. Maybe I'll try NeoVim, see if they did a better job. Maybe it's time to try Atom or Emacs again.

+8
vim
source share
1 answer

I think the main problem is that the file was modified externally, see http://vim.wikia.com/wiki/Have_Vim_check_automatically_if_the_file_has_changed_externally to reload it when this happens

-one
source share

All Articles