Home Explore Blog CI



neovim

18th chunk of `runtime/doc/api.txt`
09e37fe26fdaa81c3b5340711a78af56edc6cf2f4da4053a0000000100000fd2
 Defines the `client` object returned by |nvim_get_chan_info()|.

    Clients should call this just after connecting, to provide hints for
    debugging and orchestration. (Note: Something is better than nothing!
    Fields are optional, but at least set `name`.)

    Can be called more than once; the caller should merge old info if
    appropriate. Example: library first identifies the channel, then a plugin
    using that library later identifies itself.

    Attributes: ~
        |RPC| only
        Since: 0.3.0

    Parameters: ~
      • {name}        Client short-name. Sets the `client.name` field of
                      |nvim_get_chan_info()|.
      • {version}     Dict describing the version, with these (optional) keys:
                      • "major" major version (defaults to 0 if not set, for
                        no release yet)
                      • "minor" minor version
                      • "patch" patch number
                      • "prerelease" string describing a prerelease, like
                        "dev" or "beta1"
                      • "commit" hash or similar identifier of commit
      • {type}        Must be one of the following values. Client libraries
                      should default to "remote" unless overridden by the
                      user.
                      • "remote" remote client connected "Nvim flavored"
                        MessagePack-RPC (responses must be in reverse order of
                        requests). |msgpack-rpc|
                      • "msgpack-rpc" remote client connected to Nvim via
                        fully MessagePack-RPC compliant protocol.
                      • "ui" gui frontend
                      • "embedder" application using Nvim as a component (for
                        example, IDE/editor implementing a vim mode).
                      • "host" plugin host, typically started by nvim
                      • "plugin" single plugin, started by nvim
      • {methods}     Builtin methods in the client. For a host, this does not
                      include plugin methods which will be discovered later.
                      The key should be the method name, the values are dicts
                      with these (optional) keys (more keys may be added in
                      future versions of Nvim, thus unknown keys are ignored.
                      Clients must only use keys defined in this or later
                      versions of Nvim):
                      • "async" if true, send as a notification. If false or
                        unspecified, use a blocking request
                      • "nargs" Number of arguments. Could be a single integer
                        or an array of two integers, minimum and maximum
                        inclusive.
      • {attributes}  Arbitrary string:string map of informal client
                      properties. Suggested keys:
                      • "pid": Process id.
                      • "website": Client homepage URL (e.g. GitHub
                        repository)
                      • "license": License description ("Apache 2", "GPLv3",
                        "MIT", …)
                      • "logo": URI or path to image, preferably small logo or
                        icon. .png or .svg format is preferred.

nvim_set_current_buf({buffer})                        *nvim_set_current_buf()*
    Sets the current window's buffer to `buffer`.

    Attributes: ~
        not allowed when |textlock| is active or in the |cmdwin|
        Since: 0.1.0

    Parameters: ~
      • {buffer}  Buffer id

nvim_set_current_dir({dir})                           *nvim_set_current_dir()*
    Changes the global working directory.

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {dir}  Directory path

nvim_set_current_line({line})                        *nvim_set_current_line()*
    Sets the text on the current line.

    Attributes: ~
        not allowed when |textlock| is active
   

Title: Nvim API: Detailed Client Information and Buffer/Directory/Line Manipulation
Summary
This section provides further details on the `nvim_set_client_info()` API function, elaborating on the 'version', 'type', 'methods', and 'attributes' parameters for client identification. It also covers API functions for manipulating the Nvim environment: `nvim_set_current_buf()` for setting the current buffer, `nvim_set_current_dir()` for changing the global working directory, and `nvim_set_current_line()` for setting the text on the current line.