diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2020-01-12 23:41:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-12 23:41:55 -0800 |
commit | 92316849863bb2661ee5b4bb284f56163fed27ad (patch) | |
tree | 92b6f7d210c3dcca462b4ba48923dd65f61416ed /runtime/doc/api.txt | |
parent | dfb676fe0d64c708c0c334b09c947db1bae4736d (diff) | |
download | rneovim-92316849863bb2661ee5b4bb284f56163fed27ad.tar.gz rneovim-92316849863bb2661ee5b4bb284f56163fed27ad.tar.bz2 rneovim-92316849863bb2661ee5b4bb284f56163fed27ad.zip |
doc [ci skip] #11656
Diffstat (limited to 'runtime/doc/api.txt')
-rw-r--r-- | runtime/doc/api.txt | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index f8fdd64a9b..39b6c6417d 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -183,21 +183,17 @@ External programs (clients) can use the metadata to discover the API, using any of these approaches: 1. Connect to a running Nvim instance and call |nvim_get_api_info()| via - msgpack-rpc. This is best for clients written in dynamic languages which + msgpack-RPC. This is best for clients written in dynamic languages which can define functions at runtime. - 2. Start Nvim with the |--api-info| option. Useful for clients written in - statically-compiled languages. - - 3. Use the |api_info()| Vimscript function. - -Example: To get a human-readable list of API functions: > - :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val.name') -< -Example: To get a formatted dump of the API using python (requires the -"pyyaml" and "msgpack-python" modules): > - nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' + 2. Start Nvim with |--api-info|. Useful for statically-compiled clients. + Example (requires Python "pyyaml" and "msgpack-python" modules): > + nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' < + 3. Use the |api_info()| Vimscript function. > + :lua print(vim.inspect(vim.fn.api_info())) +< Example using |filter()| to exclude non-deprecated API functions: > + :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val.name') ============================================================================== API contract *api-contract* |