From: Reid Thompson <reid.thompson / ateb.com>
Subject: Re: OT: Vim->Ruby and back ?
Date: Fri, 28 Apr 2006 03:05:21 +0900

> Meino Christian Cramer wrote:
> > Hi,
> >
> >  sorry for this offtopic mail, but I asked this on the vim-user
> >  mailing list and git no answer...
> >
> >  What I wnat to do seems to be simple: I want to write a script
> >  with vim and -- without saveing it -- pass it to the ruby interpreter
> >  and get back the output including stderr AND stdout back into a new
> >  buffer.
> >
> >  this.possible? && if true 
> > 	anser = how.ask(self)
> >  end
> >
> >  Evening.nice!
> >  mcc
> >
> >  :)
> >
> >
> >   
> I pulled this from the web, or the mailing list, somewhere..... a google 
> on it should point you to the correct author...
> 
> in .gvimrc/.vimrc add
> 
> map <C-I> :!rm -f /tmp/*put<C-M> :w /tmp/input<C-M> :!/bin/ruby 
> /tmp/input > /tmp/output 2>&1<C-M> :vs +e! /tmp/output<C-M><C-W>l
> 
> map <C-L> <C-W>o
> 
> 
> short form of descriptions
> <CTRL-I> execute and paste results in left side of vertical split
> <CTRL-L><CTRL-W>  close left side of vertical split
> 

Thanks a lot for that trick, Reid ! :)

But this only write the buffer, start ruby, exute that file with ruby
with ridirected output to another file and reads back that file into
vim. Additionally it does not check, whether both files already
exist...thex will be overwritten simply.

I wanted to exeute ruby with the buffer contents without writing to
the disk at all for that reason.

Is this possible ?

Ruby!
mcc