vim.secure
Methods2
function M.read(path: string) -> If nil | boolean | string
If {path} is a file: attempt to read the file, prompting the user if the file should be trusted.
If {path} is a directory: return true if the directory is trusted (non-recursive), prompting the user as necessary.
The user's choice is persisted in a trust database at $XDGSTATEHOME/nvim/trust.
Parameters
pathstringPath to a file or directory to read.
Returns
Ifnil | boolean | string{path} is not trusted or does not exist, returns
nil. Otherwise, returns the contents of {path} if it is a file, or true if {path} is a directory.
See:
|:trust|
@since 11
function M.trust(opts: vim.trust.opts) -> (success boolean, msg string)
Manage the trust database.
The trust database is located at |$XDGSTATEHOME|/nvim/trust.
Parameters
optsvim.trust.opts
Returns
successbooleantrue if operation was successful
msgstringfull path if operation was successful, else error message
@since 11