package vcaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Unshadow_buffer := Buffer
module Unshadow_command := Command
module Buffer = Unshadow_buffer
module Channel_info : sig ... end
module Client_info : sig ... end

Client_info is present for every remote, ui, embedder, host, or plugin attached to neovim.

module Color : sig ... end
module Command = Unshadow_command
module Error_type = Nvim_internal.Error_type
module Highlighted_text : sig ... end
module Keymap : sig ... end
module Mark : sig ... end
module Mode : sig ... end
module Namespace : sig ... end
module Nvim : sig ... end
module Position : sig ... end
module Tabpage : sig ... end
module Type = Nvim_internal.Phantom
module Ui : sig ... end
module Vcaml_error : sig ... end
module Version = Nvim_internal.Version
module Window : sig ... end
val version : Version.t

API version for which this library is built (not the same as the Neovim version).

module Client : sig ... end
module Api_call : sig ... end

A 'a Api_call.t is a thunked call to neovim returning a Msgpack-encoded 'a. No RPC traffic is generated until an Api_call.t is invoked via run or run_join.

module Defun : sig ... end
val wrap_viml_function : type_:('fn, 'leftmost, 'out) Defun.Vim.t -> function_name:string -> 'fn

Given the name of a function available in Vimscript (VimL) along with its arity (see Defun.Vim), return a regularly-typed OCaml function that calls said function.

This is intended for client authors to delegate work back to Neovim, possibly to call an existing Vimscript function. Before reaching for this function, please check the functions available in Nvim, Buffer, Window and Tabpage to see that the functionality you intend to wrap isn't directly exposed in the API.

val register_request_blocking : _ Client.t -> name:string -> type_:('fn, 'leftmost) Defun.Ocaml.Sync.t -> f: (keyboard_interrupted:unit Async.Deferred.t -> client:[ `connected ] Client.t -> 'fn) -> unit

register_request_blocking and register_request_async register functions that can be called from Neovim via rpcrequest and rpcnotify respectively. This is achieved by adding a listener to the Neovim msgpack_rpc bus.

A blocking request will block Neovim from processing user input or communication over other channels until a response is returned. Neovim will continue to process calls sent over the same channel while a blocking request is in flight, which means nested calls are supported.

When the user presses Ctrl-C to interrupt a blocking call, keyboard_interrupted will be determined. Use that to run any necessary cleanup. If you call back into Neovim during the blocking RPC, consider whether a keyboard interrupt should prevent those calls from being run.

An async request will enqueue logic on Neovim's event loop instead of blocking. Importantly, the state of the editor may have changed between the time the async request was made and the time Neovim process any of its logic.

val register_request_async : _ Client.t -> name:string -> type_:'fn Defun.Ocaml.Async.t -> f:(client:[ `connected ] Client.t -> 'fn) -> unit
module Expert : sig ... end
module Private : sig ... end