vim | extra files

Hey, when i edit a file, even when i write to it (:w), it gives me these extra files, what causes this and can i get rid of them optionally? Thanks in advance.
No description
7 Replies
dys 🐙
dys 🐙2mo ago
Those are backups of the previous version in case you accidentally lose something. How you turn them off, I dunno.
Jochem
Jochem2mo ago
they should also just go away once you close the file unless something went wrong or you force-quit vim
snxxwyy
snxxwyyOP2mo ago
i'm not sure if anything went wrong? here's an example. That file just stays there, and sometimes there's more like in the pic.
snxxwyy
snxxwyyOP2mo ago
like dys says, if they're backups then i understand why they're there, but i feel that could clutter pretty easily eventually haha
clevermissfox
clevermissfox2mo ago
It looks like you’re showing hidden files. In windows file explorer you go to View -> Show -> Hidden Files/Folders and uncheck it. Or System files and folders sometimes. If you’re on a different os , google how to hide Hidden files and folders
ἔρως
ἔρως2mo ago
that is normal. what some editors do is to create the temporary file, so they can see if they can write into that location and when you save the file, what happens is that the editor will swap the files and delete the old one in this case, it's actually in case vim failed to save the file: https://vimdoc.sourceforge.net/htmldoc/recover.html
Roman
Roman2mo ago
Stack Overflow
How do I turn off automatic saving of a vim file with a ~ suffix
In my environment, I share vim configuration with other developers (and have my own configuration additions as well) in various .vimrc files. Some places in the environment, I edit a file in vim and

Did you find this page helpful?