Loading ...
Sorry, an error occurred while loading the content.

piping never-ending STDIN to vim ( == tail -f with syntax hiliting)

Expand Messages
  • h200@ied.com
    Hi, I would like to know how to tell vim that the STDIN will never end, so don t bother displaying Vim: Reading from stdin... but rather display immediately
    Message 1 of 3 , Apr 2 9:30 AM
    • 0 Attachment
      Hi,

      I would like to know how to tell vim that the STDIN will
      never end, so don't bother displaying

      Vim: Reading from stdin...

      but rather display immediately whatever you get, and keep
      getting more input (at least every half a second or so), in
      order to display whichever line I want to see.

      In this aspect, the effect would be similar to standard
      less behavior, except that I would still have syntax
      hiliting and searches and all the goodies of vim.

      Thanks,

      JJ
    • A. J. Mechelynck
      ... I may be wrong, but I believe it s not possible. IIUC, Vim s editing strategy is to read the whole file into memory, then display it and allow the user
      Message 2 of 3 , Apr 3 5:36 AM
      • 0 Attachment
        h200@... wrote:
        >
        > Hi,
        >
        > I would like to know how to tell vim that the STDIN will
        > never end, so don't bother displaying
        >
        > Vim: Reading from stdin...
        >
        > but rather display immediately whatever you get, and keep
        > getting more input (at least every half a second or so), in
        > order to display whichever line I want to see.
        >
        > In this aspect, the effect would be similar to standard
        > less behavior, except that I would still have syntax
        > hiliting and searches and all the goodies of vim.
        >
        > Thanks,
        >
        > JJ
        >
        >
        >
        I may be wrong, but I believe it's not possible. IIUC, Vim's editing
        "strategy" is to read the whole file into memory, then display it and
        allow the user to edit it. If the editfile is a device which will
        produce endless data without an end-of-file signal (such as, but not
        limited to, /dev/zero on Unix), Vim will never reach the end of its
        input reading and will, IIUC, either have to be killed manually, or
        terminate when reaching the end of available memory size (system memory
        or 'maxmem'/'maxmemtot' memory, whichever is smaller; the latter will
        not go higher than 2 GB, at least not on systems with 32-bit longint
        format -- it's not clear to me [conflict between ":help 'maxmemtot'" and
        ":help limits"] whether it will go higher on 64-bit machines).

        Best regards,
        Tony.
      • Michael Naumann
        ... Though your statement is essentially true (to my knowledge) you do not have to manually kill your vim in such a case. You can also ^C to terminate the
        Message 3 of 3 , Apr 3 6:56 AM
        • 0 Attachment
          On Sunday 03 April 2005 14:36, A. J. Mechelynck wrote:
          > I may be wrong, but I believe it's not possible. IIUC, Vim's editing
          > "strategy" is to read the whole file into memory, then display it and
          > allow the user to edit it. If the editfile is a device which will
          > produce endless data without an end-of-file signal (such as, but not
          > limited to, /dev/zero on Unix), Vim will never reach the end of its
          > input reading and will, IIUC, either have to be killed manually, or
          > terminate when reaching the end of available memory size (system memory
          > or 'maxmem'/'maxmemtot' memory, whichever is smaller; the latter will
          > not go higher than 2 GB, at least not on systems with 32-bit longint
          > format -- it's not clear to me [conflict between ":help 'maxmemtot'" and
          > ":help limits"] whether it will go higher on 64-bit machines).
          >
          > Best regards,
          > Tony.

          Though your statement is essentially true (to my knowledge) you do not
          have to manually kill your vim in such a case. You can also ^C to
          terminate the reading from stdin.
          You can try
          yes|vim -
          But ... don't wait too long to hit ^C, "yes" will produce it's output
          rather quickly

          HTH, Michael
        Your message has been successfully submitted and would be delivered to recipients shortly.