Skip to content

Instantly share code, notes, and snippets.

@violetyk
Last active December 22, 2015 20:08
Show Gist options
  • Save violetyk/6523859 to your computer and use it in GitHub Desktop.
Save violetyk/6523859 to your computer and use it in GitHub Desktop.
let cmd = 'vmstat 1 5 &'
let sub = vimproc#popen2(cmd)
" echo sub.pid
echo keys(sub)
echo keys(sub.stdout)
while !sub.stdout.eof
let res = sub.stdout.read()
call append(line('$'), split(res, '\r\n\|\r\|\n'))
endwhile
" let [cond, status] = sub.waitpid()
" ----------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment