vim.uri
Methods6
function M.uri_encode(str: string, rfc: "rfc2396" | "rfc2732" | "rfc3986" | nil) -> encoded string
URI-encodes a string using percent escapes.
Parameters
strstringstring to encode
rfc"rfc2396" | "rfc2732" | "rfc3986" | nil
Returns
encodedstringstring
function M.uri_decode(str: string) -> decoded string
URI-decodes a string containing percent escapes.
Parameters
strstringstring to decode
Returns
decodedstringstring
function M.uri_from_fname(path: string) -> URI string
Gets a URI from a file path.
Parameters
pathstringPath to file
Returns
URIstring
function M.uri_from_bufnr(buf: integer) -> URI string
Gets a URI from a bufnr.
function M.uri_to_fname(uri: string) -> filename string
Gets a filename from a URI.
Parameters
uristring
Returns
filenamestringor unchanged URI for non-file URIs
function M.uri_to_bufnr(uri: string) -> bufnr integer
Gets the buffer for a uri. Creates a new unloaded buffer if no buffer for the uri already exists.