Em 23-07-2015 13:29, Bruce Dubbs escreveu:
> Fernando de Oliveira wrote:

>> Important thing, also needed for almost all others: disable backup, or
>> remember to remove them - with (G)Vim, I just redirected them to /tmp.
>> Failure that and you have the local repository with lots of back up
>> files.
>
> I just don't use 'set backup' in /etc/vimrc or ~/.vimrc.

Bruce, I don't have 'set backup' anywhere, and (g)vim does create the
.swp files.

Using :help backup, found the following (see important WARNING further
below):

{{{
If you write to an existing file (but do not append) while the 'backup',
'writebackup' or 'patchmode' option is on, a backup of the original file
is made. The file is either copied or renamed (see 'backupcopy'). After
the file has been successfully written and when the 'writebackup' option
is on and the 'backup' option is off, the backup file is deleted. When
the 'patchmode' option is on the backup file may be renamed.

*backup-table*
'backup' 'writebackup' action ~
   off       off       no backup made
   off       on        backup current file, deleted afterwards (default)
   on        off       delete old backup, backup current file
   on        on        delete old backup, backup current file
}}}

Important *WARNING*:

{{{
'writebackup' 'wb'  boolean (default on with |+writebackup| feature, off
                                    otherwise)
                    global
                    {not in Vi}
    Make a backup before overwriting a file.  The backup is removed
    after the file was successfully written, unless the 'backup' option
    is also on.
    WARNING: Switching this option off means that when Vim fails to
    write your buffer correctly and then, for whatever reason, Vim
    exits, you lose both the original file and what you were writing.
    Only reset this option if your file system is almost full and it
    makes the write fail (and make sure not to exit Vim until the write
    was successful).
    See |backup-table| for another explanation.
    When the 'backupskip' pattern matches, a backup is not made anyway.
    NOTE: This option is set to the default value when 'compatible' is
    set.
}}}

Thus, I cannot see a *safe* way of disabling "backup" with (g)vim.

--
[]s,
Fernando
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to