Skip to content

Instantly share code, notes, and snippets.

@kamichidu
Created June 22, 2013 11:15
Show Gist options
  • Save kamichidu/5840503 to your computer and use it in GitHub Desktop.
Save kamichidu/5840503 to your computer and use it in GitHub Desktop.
let g:proc= vimproc#popen3('irb --simple-prompt')
sleep
call g:proc.stdin.write("warn 2;\n")
let g:stdout= ''
let g:stderr= ''
while 1
let g:stdout.= g:proc.stdout.read()
let g:stderr.= g:proc.stderr.read()
if g:stdout =~ '>> '
break
endif
endwhile
echo 'stdout'
echo g:stdout
echo 'stderr'
echo g:stderr
call g:proc.kill(9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment