Our developers recently updated to the latest version of vim and sense then when they edit files from the network share hosted on a FreeNAS server, they eventually cannot write the file, as the .swp file throws them a read only type of error.

I checked the permissions and they have full access. If I close VIM and delete the .swp file, they can then open the file and save the file again till the issue happens again.

Is this a FreeNAS side effect where it could be holding a file in memory?

  • What OS are the clients running? – chicks Apr 3 '17 at 13:30
  • Windows 10....... – Jason Apr 3 '17 at 15:51

Your developers could add a line like this to their .vimrc (or _vimrc in Windows):
set directory=c:\temp\,.

:help direcory in Vim shows:

List of directory names for the swap file, separated with commas.
- The swap file will be created in the first directory where this is possible.
- Empty means that no swap file will be used (recovery is impossible!).
- ...

  • 1
    This is definitely a viable workaround, but it would be nice for the swap files to be on the shared drive to prevent multiple people from editing the same file at the same time. If everybody is creating swap files on their local drives they might never realize they overwrote someone else's changes. – chicks Apr 3 '17 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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