0

I've been using VIM on a virtual machine running Kali Linux to write python scripts on a shared folder on my Windows 10 host operating system, but these empty files with names as 4 digits keep being generated after I save any changes. I have no idea why this is happening. I previously disabled backups for VIM as swap files were being generated and crowding my directory, but now I have this problem, and I always have to delete these annoying files

Snapshot of my directory:

enter image description here

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65
Hack3r
  • 1
  • Welcome to [vi.se]! Are you sure vim creates these files? Have you tried vim --clean or vim -u NONE? (PS swapfiles do go away after you exit vim, and they can be handy in a crash. But backup != swapfile.) What is the "shared folder" (network share? something else?) – D. Ben Knoble Jan 18 '21 at 20:22
  • Hello, thanks for replying! A shared folder is a folder in which both the host and the virtual machine can share files; i'm using Kali Linux as a vm on VirtualBox on my Windows 10 host operating system. I am pretty sure vim creates these files, but i tried resetting the virtual machine to see if those empty files get created again – Hack3r Jan 20 '21 at 01:08
  • Yeah the files still get created on my system :/ i really don't know why – Hack3r Jan 20 '21 at 08:43

1 Answers1

1

I believe Vim creates those temporary files to check if it is able to write the file. If you see those files, Vim wasn't able to delete those temp files (which is most likely due to an anti-virus program). See also here: https://groups.google.com/g/vim_dev/c/sppdpElxY44/m/betqMpYWHm8J

Christian Brabandt
  • 25,820
  • 1
  • 52
  • 77
  • Thanks for the reply, i tried disabling Windows Defender real-time protection but that didn't solve the issue. I think it may be a problem with my virtual machine as i am editing the files with vim from Kali Linux vm on VirtualBox; this issue doesn't occur when i edit the files from my host machine which is kind of strange – Hack3r Jan 21 '21 at 04:09