Friday, May 9, 2014

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

On 2014-05-09, Elijah Griffin wrote:
> Gary Johnson writes:
> > :new | :r !ruby %
> ...
> > Note that the % is expanded to the name of the current buffer before
> > the focus is changed to the new buffer.
>
> Not when I test it. I get:
>
> E499: Empty file name for '%' or '#', only works with ":p:h"
>
> for "VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:25:35)".
> Does it work differently in other versions?

I see that you're right and I was wrong. I did test something, but
apparently not what I wrote. Trying to do too many things at once,
I guess.

Using # instead of % does work, as you wrote earlier.

Also, my use of : in front of the r was unnecessary.

Thanks for the correction.

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: