(VIM) Interaction between "set bt=nnowrite" and "set autoread" ?

I have an instance of VIM that I keep running all the time, displaying
a file that is being modified by an external process.  I do "setlocal ar"
so that the display automatically updates when the file is modified.  This
works fine.

However, I noticed that if I (accidentally) modify (edit) the buffer, then
when the file gets modified externally, it does not auto-reload.  This, of
course, makes sense, but is not desired.  So, I looked around the help
files and found the bufftype variable, and it looks like "se bt=nowrite" is
what I want.  This makes the buffer behave a lot more like "less" and a lot
less like "vi", if you see what I mean.  However, the help file cautions
not to use this option unless you know what you're doing, since it has
(apparently undocumented) side-effects.

My testing seems to indicate that one side-effect is that "ar" no
longer works - which, in a way, makes sense - if a buffer isn't going to be
written out, then it doesn't matter (one might argue) if the external file
changes.  But again, though reasonable, this is not desired.

So, how to fix?  How to get the best of both worlds?

6/13/2005 7:42:10 PM
comp.editors 4871 articles. 0 followers. Post Follow

0 Replies

Similar Articles

[PageSpeed] 19