nvim_runtime_lua

vim.ui.img._kitty

Kitty graphics protocol implementation for vim.ui.img.

Methods4

function M.set(data: string, opts: vim.ui.img.Opts) -> (img_id integer, placement_id integer)

Transmit image bytes and place the image. Returns both IDs.

Parameters
datastring

raw image bytes

Returns
img_idinteger
placement_idinteger
function M.update(img_id: integer, placement_id: integer, opts: vim.ui.img.Opts) -> nil

Update an existing placement (flicker-free, reuses same IDs).

function M.delete(img_id: integer) -> nil

Delete an image and all its placements from the terminal. When {img_id} is math.huge, deletes all images.

function M.supported(opts: { chan: integer?, timeout: integer? } | nil) -> (supported boolean, msg nil | string)

Query whether this terminal supports the kitty graphics protocol. Blocks until the terminal responds or times out.

Parameters
opts{ chan: integer?, timeout: integer? } | nil

timeout in milliseconds (default: 1000)

Returns
supportedboolean
msgnil | string

error detail if terminal responded but not with OK