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

redirect output command

Expand Messages
  • JuanPablo
    hi, how redirect output command (r!) to new buffer? thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use
    Message 1 of 3 , Feb 1, 2009
    • 0 Attachment
      hi,
      how redirect output command (r!) to new buffer?
      thanks.

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... is not an output command but an input command. It merges the given filename after the current line (or, with a [range], the given line) of the current
      Message 2 of 3 , Feb 1, 2009
      • 0 Attachment
        On 01/02/09 21:13, JuanPablo wrote:
        > hi,
        > how redirect output command (r!) to new buffer?
        > thanks.

        :r! filename

        is not an output command but an input command. It merges the given
        filename after the current line (or, with a [range], the given line) of
        the current buffer.

        :r !command

        runs an external command and reads the output of that command into the
        current buffer. The order of space and exclamation mark is important.

        If you want to capture the output of an ex-command which displays
        messages on the message area (below the bottom status line), you can use
        the ":redir" command, whose output can be a register (including the
        unnamed register and the clipboard), a disk file, or a string variable,
        and in either "replace" or "append" modes in all cases. Then you can
        either read the file (thus assigning a buffer to it), or paste the
        register or (via the expression register) the variable into any buffer
        including a [No Name] buffer.


        Best regards,
        Tony.
        --
        Dessert is probably the most important stage of the meal, since it will
        be the last thing your guests remember before they pass out all over
        the table.
        -- The Anarchist Cookbook

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • John Beckett
        ... There is a :redir command for redirecting output from _Vim_ commands. However, if you re using :r to read something, you would just create a ... John
        Message 3 of 3 , Feb 1, 2009
        • 0 Attachment
          JuanPablo wrote:
          > how redirect output command (r!) to new buffer?

          There is a :redir command for redirecting output from _Vim_ commands.

          However, if you're using :r to read something, you would just create a
          new buffer first:

          :new
          :r !command

          John


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        Your message has been successfully submitted and would be delivered to recipients shortly.