From: Gregory Seidman Date: 2006-04-28T20:50:39+09:00 Subject: Re: OT: Vim->Ruby and back ? On Fri, Apr 28, 2006 at 11:29:35AM +0900, Meino Christian Cramer wrote: [...] } > 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. [...] } } 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 ? I can get you stderr and stdout mised together, not in separate files: 0G"ryG:new "rp:%!ruby This yanks the entire buffer into register r, opens a new window, pastes register r into the window, feeds the entire buffer into ruby's stdin and replaces the buffer with what the script writes to stdout or stderr. Unfortunately, I don't know how to distinguish between output to stdout and stderr. Since you are writing the script, however, you should know which is which. } Ruby! } mcc --Greg