[ale] inode change after vi a file ?

Björn Gustafsson bg-ale at bjorng.net
Thu Mar 30 15:38:52 EST 2006


These operations are mainly controlled by the 'backup' and
'backupcopy' settings in vim. If you want backups, you should

  :set backupcopy=yes

(which may seem counterintuitive) because that setting makes it write
the *old* contents to a new filename, and the new contents to the
original inode (actually the original file handle, if I recall
correctly).

By contrast, if you don't want them at all, you can simply

 :set nobackup

For the specific concern of log files, you can add "/var/log/*,*.log"
to the value of the 'backupskip' setting in your .vimrc to prevent it
from making copies of those files, e.g.

 :set backupskip=/tmp/*,$TEMP/*,/var/log/*,*.log

More generally, if you want vim to be as vi-like as possible, you should use

 :set compatible

I'm not sure offhand whether that has any impact on the various backup
options, but I expect that it does.

On 3/30/06, Christopher Fowler <cfowler at outpostsentinel.com> wrote:
> On Thu, 2006-03-30 at 15:10 -0500, Jerry Yu wrote:
> > do reliable atomic writes
>
> Maybe they don't.  Maybe they don't expect more than one person to have
> an excel spreadsheet open.  VI comes from a multi-user environment
> mentality.  It needs to make sure the writes are atomic.  My guess is
> that if you turn off the backup feature then you turn off this.
>
> http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl



More information about the Ale mailing list