tags:

views:

89

answers:

2

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 automagically a copy of that file with a trailing tilde suffix appears. What vim options control this? I'd like to turn the feature off, as it just clutters up my directories and spoils auto-completion on the command line.

Thanks.

+1  A: 

It sounds like you're looking for the nobackup option:

:set nobackup

Backups are not turned on by default, so you've probably got a config file somewhere that's turned them on.

Greg Hewgill
+5  A: 

If you just want to turn off backups entirely, the :set nobackup suggestion from @GregHewgill is the way to go.

However, I've been saved by Vim's backups often enough that I'd like to recommend an alternative. I have these settings in my .vimrc:

set backupdir-=.
set backupdir^=~/tmp,/tmp

The first line removes the current directory from the backup directory list (to keep the ~ backups out of your working directories). The second tells Vim to attempt to save backups to ~/tmp, or to /tmp if that's not possible. (The paths can be adjusted for your particular environment; I use set backupdir^=$TEMP on Windows, for example.)

In other words, this puts the backup files out of sight (and out of your way), but doesn't turn them off entirely.

Bill Odom
Neither this, nor Greg Hewgill's suggestion worked. I'm wondering if there is a .vimrc that gets executed AFTER my .vimrc. Is there a way to tell which .vimrc's got used from within a particular vim session?
Leonard
Check :help startup for the long explanation of what files vim reads when it starts.
speshak