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

RE: how to send the output of echo command to a window?

Expand Messages
  • John Beckett
    ... Perhaps :echomsg is more helpful? Here is a sample showing how to put text in a scratch window: function! Sample() let text = [] call add(text, First
    Message 1 of 2 , Mar 8, 2010
    • 0 Attachment
      yixiaodafang wrote:
      > Currently, when I run the echo to display multiple line of
      > the help message, the message will disappeared quickly. How
      > do I keep the message displayed so I can read them? Also, how
      > to send the message to a window so I can keep them there?

      Perhaps :echomsg is more helpful?

      Here is a sample showing how to put text in a scratch window:

      function! Sample()
      let text = []
      call add(text, 'First message')
      call add(text, 'Second message')
      call add(text, 'Third message')
      new
      setlocal buftype=nofile bufhidden=hide noswapfile
      call append(0, text)
      $d
      endfunction

      John

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.