nvim_runtime_lua

vim.filetype.match.args

@inlinedoc

Fields3

args.buf : nil | integer

Buffer number to use for matching. Mutually exclusive with {contents}

args.filename : nil | string

Filename to use for matching. When {buf} is given, defaults to the filename of the given buffer number. The file need not actually exist in the filesystem. When used without {buf} only the name of the file is used for filetype matching. This may result in failure to detect the filetype in cases where the filename alone is not enough to disambiguate the filetype.

args.contents : string[] | nil

An array of lines representing file contents to use for matching. Can be used with {filename}. Mutually exclusive with {buf}.