From: Meino Christian Cramer Date: 2006-04-28T11:29:35+09:00 Subject: Re: OT: Vim->Ruby and back ? From: Reid Thompson 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 :!rm -f /tmp/*put :w /tmp/input :!/bin/ruby > /tmp/input > /tmp/output 2>&1 :vs +e! /tmp/outputl > > map o > > > short form of descriptions > execute and paste results in left side of vertical split > 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