JarrodCTaylor/vim-plugin-starter-kit

Request: Can you update the wiki to include examples of using vim8 async features

Closed this issue · 3 comments

Hi

I would like to use vim8 async features with python interaction. Can you please update the wiki with some examples as how this can be done?

Thanks in advance :)

What are you trying to accomplish? I have not written anything yet utilizing the new async features, but it appears as though utilizing them in functions that use Python will not require anything special.

function! AsyncExample()
    let job = job_start("sleep 5" ,{'exit_cb': 'ExitHandler'})
endfunction

function! ExitHandler(job, status)
    echo "The job is done. [Info] Job: " . a:job . " Status: " . a:status
endfunction

Then :call AsyncExample

There are other callback options, but that example is really all there appears to be to it.

@JarrodCTaylor i am trying to write a perforce plugin on the lines of fugitive and thought of utilizing the async feature and your template.

Thanks for the feedback and suggestion.

Sure thing. Good luck.