turning off automatic ~ backup file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

turning off automatic ~ backup file

Bernard, Jim
Using gVim 6.3 on Windows XP SP2.

Whenever I edit and save a file (i.e. test.txt) and exit gVim, I get a
copy of the file with a ~ appended (i.e. test.txt~) in the same folder
as the original file. I typically deal with large finite element model
input decks (400 - 600 Mb) and having a copy of each file I edit laying
around is eating up a bunch of disk space and it's a minor annoyance to
have to manually delete each ~ file as it's created.

I'm assuming that this is an old revision copy and there's a setting
that controls the creation. I haven't been able to find any rcfile
parameter that controls this though.

Anyone have any idea how to disable the creation of the ~ file?

Thanks,

--
Jim Bernard

CAE Technical Consultant          E-mail: [hidden email]
UGS                               Phone:  +1.513.576.5872
2000 Eastman Drive                Fax:    +1.513.576.2080
Milford, Ohio 45150               WWW:    http://www.ugs.com/

Reply | Threaded
Open this post in threaded view
|

Re: turning off automatic ~ backup file

Tim Chase-2
> Anyone have any idea how to disable the creation of the ~
> file?

To disable backups completely, in your vimrc file, simply add the
following:

        set nobackup nowritebackup

Depending on your settings of 'backup' and 'writebackup' you can
get varied behaviors, as decribed in the table in the help found at

        :help backup
        :help backup-table

Alternatively, there's a 'backupskip' option you can modify that
will allow you to keep backups for other files, but specify that
certain files don't ever get backed up.  Thus, if you like backup
behavior in general, but don't want your decks backed up, you
might be able to do something like

        :set backupskip+=/path/to/decks/*.txt

assuming all your deck files are in that given directory and all
are the only *.txt files in there.

Just a couple ideas to pursue.

-tim







Reply | Threaded
Open this post in threaded view
|

Re: turning off automatic ~ backup file

Tim Chase-2
In reply to this post by Bernard, Jim
> I've searched all local hard drives for other occurrences of
> any filename containing vimrc or exrc and have not found any.
>
> My current _vimrc file and a screen grab of :set from within
> gvim is attached.

Looking at your _vimrc file, it looks like you're sourcing
vimrc_example.vim which, if you're not running on VMS, turns
backup back on.  If you just move the backup lines from your
vimrc down to the bottom (or at least below sourcing those two
the vimrc_example and mswin.vim) they should override any other
changes made by those files.

-tim





Reply | Threaded
Open this post in threaded view
|

RE: turning off automatic ~ backup file

Bernard, Jim
In reply to this post by Bernard, Jim
Duh. Sorry for wasting your time by overlooking the obvious ;)

Thanks!

-----Original Message-----
From: Tim Chase [mailto:[hidden email]]
Sent: Monday, August 15, 2005 5:02 PM
To: Bernard, Jim
Cc: [hidden email]
Subject: Re: turning off automatic ~ backup file

> I've searched all local hard drives for other occurrences of
> any filename containing vimrc or exrc and have not found any.
>
> My current _vimrc file and a screen grab of :set from within
> gvim is attached.

Looking at your _vimrc file, it looks like you're sourcing
vimrc_example.vim which, if you're not running on VMS, turns
backup back on.  If you just move the backup lines from your
vimrc down to the bottom (or at least below sourcing those two
the vimrc_example and mswin.vim) they should override any other
changes made by those files.

-tim





Reply | Threaded
Open this post in threaded view
|

Re: turning off automatic ~ backup file

A.J.Mechelynck
----- Original Message -----
From: "Bernard, Jim" <[hidden email]>
To: "Tim Chase" <[hidden email]>
Cc: <[hidden email]>
Sent: Tuesday, August 16, 2005 2:49 PM
Subject: RE: turning off automatic ~ backup file


> Duh. Sorry for wasting your time by overlooking the obvious ;)
>
> Thanks!
>
> -----Original Message-----
> From: Tim Chase [mailto:[hidden email]]
> Sent: Monday, August 15, 2005 5:02 PM
> To: Bernard, Jim
> Cc: [hidden email]
> Subject: Re: turning off automatic ~ backup file
>
>> I've searched all local hard drives for other occurrences of
>> any filename containing vimrc or exrc and have not found any.
>>
>> My current _vimrc file and a screen grab of :set from within
>> gvim is attached.
>
> Looking at your _vimrc file, it looks like you're sourcing
> vimrc_example.vim which, if you're not running on VMS, turns
> backup back on.  If you just move the backup lines from your
> vimrc down to the bottom (or at least below sourcing those two
> the vimrc_example and mswin.vim) they should override any other
> changes made by those files.
>
> -tim

Just for this reason, the "source" statement should be near the top. I use:

    set nocompatible
    if has("unix")
        language messages C
    else
        language messages en
    endif
    runtime vimrc_example.vim
    " all other customizations come here

(i.e., only two imperative staments before the vimrc_example; all the rest
comes after). -- The first line is not necessary when there is no -u
command-line parameter, but it may be needed otherwise (let's say a
project-specific vimrc starts by sourcing this one).


Best regards,
Tony.