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

4
  • Welcome to Vi and Vim! 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
    Commented Jan 18, 2021 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
    Commented Jan 20, 2021 at 1:08
  • Yeah the files still get created on my system :/ i really don't know why
    – Hack3r
    Commented Jan 20, 2021 at 8:43
  • Have a look at How to debug my vimrc
    – D. Ben Knoble
    Commented Jan 20, 2021 at 16:28

1 Answer 1

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

1
  • 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
    Commented Jan 21, 2021 at 4:09

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.