Yakov Lerner wrote:
On 9/7/06, Wolfgang Schmidt <[EMAIL PROTECTED]> wrote:

       Hi,

I want to use vim to watch the output of another program (logfile,
compilation output, ...). I want to have something like the
functionality of the unix "tail" command, that is, if something new is
written to the file, I want the buffer to get updated. I know I can
reload the file manually with ":e", but I want it to be done
automatically. I tried the autoread option (":set ar"), but I still have
to reload the buffer by hand, the buffer does not get updated
automatically. Could anybody tell me, how autoread is supposed to work?

Autoread is something different and wont help you.
Try this:
   set nolz | while 1 | e | redraw | $ | sleep 1 | endw
which does approximately what you need. Cancel by Ctrl-C.
Or bundle this line into mapping and/or custom functions.

Yakov
As I get it, the "autoread" option is used to make vim reread the file when a user event (keystroke etc) occurs; it's not a continuous process of checking and updating, but has to be triggered by the user. Your solution does periodical checking and updating at the cost of blocking vim for other tasks, which in my case is ok, for a "tail" command also does block the used shell.

Thanx to  you and Tony for your answers, this helped me a lot

   Wolfgang

Reply via email to