On Fri, Jun 09, 2006 at 02:03:33PM +0200, A.J.Mechelynck wrote:
> >
> To ask only if something more than just time or mode have changed, you
> can paste the following (untested, but I believe it should work) into
> your vimrc:
>
> :autocmd FileChangedShell *
> \ if (v:fcs_reason == "mode") || (v:fcs_reason == "time") |
> \ let v_fcs_choice = "" |
> \ else |
> \ let v:fcs_choice = "ask" |
> \ endif
Murphy's Law strikes again: if it is untested, then there is a typo.
Change v_fcs_choice to v:fcs_choice . This would make a good example to
include in the docs. I wonder if I can get it down to one or two lines:
:au FileChangedShell * let v:fcs_choice = (v:fcs_reason == "mode") ? "" : "ask"
Not really short enough. The following restores the "mode or time"
behavior of your version and is a little shorter, but it is too cryptic
to be used in the docs:
:au FileChangedShell * let v:fcs_choice=(v:fcs_reason=~"e$")?"":"ask"
HTH --Benji Fisher