I wrote this little function to update my plugins from within vim:
function! UpdatePlugins()
call system('for f in ~/.vim/bundle/*; do cd $f; git pull; done')
endfunction
command! UpdatePlugins call UpdatePlugins()
How can I get the output of this to be piped into a new buffer in real time? By real time, I mean this: If I were to run that system command in my shell, over the course of a few seconds each git pull would run and print lines to the standard output. I would like for those lines to be piped into a buffer as they are printed.
I know that I can do this to open a new buffer with the results:
function! UpdatePlugins()
let x = system('for f in ~/.vim/bundle/*; do cd $f; git pull; done')
tabnew
put=x
endfunction
command! UpdatePlugins call UpdatePlugins()
But waiting for the pulls to complete is less than ideal.