Friday, May 9, 2014

Re: How can I put the output of a code in a buffer ?

On 2014-05-09, Arup Rakshit wrote:

> Now when I will run - !ruby %, I want the output to come to a new
> separate buffer in the same tab. how to do the same ?

There are a number of ways to do that. Here's one.

:new | :r !ruby %

That opens a new window above the current one, then reads the output
of your program into it. See

:help :read!

Note that the % is expanded to the name of the current buffer before
the focus is changed to the new buffer. Note also that with this
method there will be an extra, empty line at the top of the new
buffer.

Regards,
Gary

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment