Whenever I open a file with Vim, the program automatically creates a copy of the file ending with a tilde~

When I'm done editing a few files, the folder is littered with extraneous files ending in ~

Is it possible to have Vim automatically remove said files? Or as an alternative, is it possible to have Windows hide them?

link|improve this question

feedback

1 Answer

up vote 3 down vote accepted

From here:

Backup Files

Vim by default creates a backup of an edited file in the same directory as the file called filename~. To prevent clutter, many users tell vim to use a backup directory:

set backupdir=~/.vim/backup,/tmp

Or, it's possible to even disable this behaviour:

set nobackup
set nowritebackup
set noswapfile    ! (additionally disable swap files)
link|improve this answer
1  
i put these backupfiles to $TEMP, otherwise +1 – akira May 10 '10 at 18:50
I didn't write that article there, I just quoted. – Joey May 10 '10 at 18:58
feedback

Your Answer

 
or
required, but never shown

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