Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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)
share|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

Also see my "autohide" plugin for hiding those pesky files that oh-so-occasionally become a life saver.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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