Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .