Last active
August 29, 2015 14:01
-
-
Save kamichidu/0e1e9b4e1d4db244f0eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! s:sync(pm) | |
| let [out, err, stat]= a:pm.read('ji', [' > ']) | |
| while stat !=# 'matched' | |
| let [out, err, stat]= a:pm.read('ji', [' > ']) | |
| endwhile | |
| return out | |
| endfunction | |
| let pm= vital#of('vital').import('ProcessManager') | |
| if 'new' ==# pm.touch('ji', 'java -jar ' . expand('~/Documents/sources/java/java-javaimport/target/unite-javaimport-0.02-jar-with-dependencies.jar')) | |
| call s:sync(pm) | |
| endif | |
| call pm.writeln('ji', 'path add ' . expand('~/Documents/apps/java7/jdk7u55.x64/jre/lib/rt.jar')) | |
| echo s:sync(pm) | |
| call pm.writeln('ji', 'list --public') | |
| echo s:sync(pm) | |
| let start_time= reltime() | |
| call pm.writeln('ji', 'list --public') | |
| echo s:sync(pm) | |
| echo reltimestr(reltime(start_time)) | |
| call pm.writeln('ji', 'quit') | |
| call pm.term('ji') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! s:sync(pm) | |
| let out= a:pm.stdout.read() | |
| while out !~# "\\(^\\|\n\\)" . ' > ' | |
| let out.= a:pm.stdout.read() | |
| endwhile | |
| return substitute(out, "\\(^\\|\n\\)" . ' > ', '', '') | |
| endfunction | |
| let pipe= vimproc#popen3('java -jar ' . expand('~/Documents/sources/java/java-javaimport/target/unite-javaimport-0.02-jar-with-dependencies.jar')) | |
| echo s:sync(pipe) | |
| call pipe.stdin.write('path add ' . expand('~/Documents/apps/java7/jdk7u55.x64/jre/lib/rt.jar') . "\n") | |
| echo s:sync(pipe) | |
| call pipe.stdin.write('list --public' . "\n") | |
| echo s:sync(pipe) | |
| let start_time= reltime() | |
| call pipe.stdin.write('list --public' . "\n") | |
| echo s:sync(pipe) | |
| echo reltimestr(reltime(start_time)) | |
| call pipe.stdin.write('quit' . "\n") | |
| call pipe.waitpid() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment