nvim_runtime_lua

vim.ui.img

Methods3

function M.set(data_or_id: string | integer, opts: vim.ui.img.Opts | nil) -> id integer

Display an image or update an existing one.

When {dataorid} is a string, displays the image bytes at the position given by {opts}. Returns an integer id for later use.

When {dataorid} is an integer (a previously returned id), updates the image with new {opts}.

Parameters
data_or_idstring | integer

image bytes (string) or existing id (integer)

optsvim.ui.img.Opts | nil
Returns
idinteger
function M.get(id: integer) -> opts vim.ui.img.Opts | nil

Get the opts for an image.

Parameters
idinteger
Returns
optsvim.ui.img.Opts | nil

copy of image opts, or nil if not found

function M.del(id: integer) -> found boolean

Delete an image, or all images if math.huge is given as the id.

Parameters
idinteger

image id, or math.huge to delete all images

Returns
foundboolean

true if any image existed