9

When I try to save a file I get the attached error almost every time. I haven't opened or modified the file in different editor.

This is for Elixir files, and the code get compiled. Not sure if that is the cause of this error.

Is there anyway that I can bypass this as it is getting super annoying. Thanks

enter image description here

6
  • Has the file's modification date been updated? Commented Jan 3, 2018 at 1:02
  • No, I use :w to save the file. I get that error. I don't even compile or anything. I just go to another editor, then I come back to it and change a character and type :w and I get the same error again!!
    – Mr H
    Commented Jan 3, 2018 at 1:03
  • But something seems to modify the file, I think? You can use e.g. ls -l (or a graphical file manager) to check the file's modification time. Commented Jan 3, 2018 at 1:04
  • Ok, I ran the ls -l on the file, then I used :w and I got the error. so I saved the file anyway. Then I ran the ls -l which it was updated as I expected. Then I ran ls -l again and again to make sure that nothing is changed which was the case. Then when I tried to run the :w I got the same error.
    – Mr H
    Commented Jan 3, 2018 at 1:10
  • 2
    :h W11 it also talks about how to prevent this error. Commented Jan 3, 2018 at 7:33

4 Answers 4

2

By any chance are you using Acronis True Image? I found that the new "Active Protection" they provide was causing exactly this problem. Going into Settings -> Manage Processes and adding the full path to gvim.exe as a trusted application got rid of the problem.

2

As correctly stated by Christian Brabandt in the comments, use :h W11 to see possible reasons for such warning.

In my own case I was editing file located on the Samba share under Windows and possible inconsistency in timezones across Win/*nix invoked such warning. Putting the file to Linux machine solved the problem for me.

2

I saw this warning when editing a file on a cifs share. My local machine time was ahead of the remote system (by ~30min) due to incorrect date&time/timezone setting. Once sorted,the vim warning stopped !

vim 8.0 Local and remote systems: Linux

0

I faced the same issue while editing a Redis configuration. This error occurred when I was editing a file while a process or service was using that file.

By stopping or killing the respective process, I was then able to edit and save the file without error.

1
  • 2
    Welcome to Vi and Vim! I've edited for some clarity—if I've accidentally misunderstood what you mean, you should be able to rollback the edit (or let me know). You can also edit yourself.
    – D. Ben Knoble
    Commented Jul 13, 2021 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.