Skip to content

Instantly share code, notes, and snippets.

@mhinz
Created June 15, 2016 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhinz/55c6dd6ea137454b16a654c3a1f20dc0 to your computer and use it in GitHub Desktop.
Save mhinz/55c6dd6ea137454b16a654c3a1f20dc0 to your computer and use it in GitHub Desktop.
function! s:dump_api()
let api = msgpackparse(systemlist('nvim --api-info'))[0]
for v in api.functions
echohl Function
echomsg v.name._VAL[0]
echohl NONE
echohl Title
echon '('. join(map(v.parameters, 'v:val[1]._VAL[0] .":". v:val[0]._VAL[0]'), ', ') .')'
echohl NONE
echon ' -> '
echohl Constant
echon v.return_type._VAL[0]
echohl NONE
echohl Comment
echon ' async: '. (v.async ? '✓' : '☓') .', can fail: '. (has_key(v, 'can_fail') && v.can_fail ? '✓' : '☓')
echohl NONE
endfor
endfunction
command! DumpAPI call s:dump_api()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment