Right you are Yakov.
This is doing what I needed:
autocmd FileChangedShell __edit_* if !filereadable(expand("%")) |
bdelete | endif
> -----Original Message-----
> From: Jacob Lerner [mailto:qlerner@...]
> Sent: Friday, February 27, 2004 10:57 AM
> To: David Fishburn
> Cc: vim@...
> Subject: Re: bdelete unreadable files
> David Fishburn wrote:
> >Vim 6.2.234 WinXP
> >I am trying to create an autocmd in Vim to detect the file
> is no longer
> >available, and issue a bdelete. ...
> >Then I a have tried the following autocmds:
> > autocmd BufReadPost __edit_* if
> !filereadable(expand("%")) | echoerr
> >'file not readable'.expand("%") | endif
> > autocmd BufReadPre __edit_* if
> !filereadable(expand("%")) | bdelete
> >| endif
> >Neither work.
> Your problem with BufReadPre is that when file does not exist,
> BufReadPre is not invoked
> (see :help BufReadPre)
> You need to use some event other that BufReadPre, maybe
> BufEnter and/or
> In addition, 'set autoread' does not cause buffer-reread when file is
> deleted. (help autoread).