A community-driven vim distribution

Home | About | Quick start guide | Documentation | Development | Community | Sponsors

Available APIs » job


job api provides a async job control api for vim and neovim.

let s:JOB = SpaceVim#api#import('job')

function! s:on_stdout(id, data, event) abort
   " do something with stdout

function! s:on_stderr(id, data, event) abort
  " do something with stderr

function! s:on_exit(id, data, event) abort
  " handle exit code

let cmd = ['python', '']

call s:JOB.start(cmd,
    \ {
    \ 'on_stdout' : function('s:on_stdout'),
    \ 'on_stderr' : function('s:on_stderr'),
    \ 'on_exit' : function('s:on_exit'),
    \ }
    \ )


function name description
start(cmd, argv) start a job, return the job id
send(id, data) send data to a job
stop(id) stop a jobe with specific job id
status(id) check the status of a job with the specific job id
list() list all the jobs

Powered by Jekyll, Help improve this page