Set a Lua table with meta-data about the plugin, such as version.
The passed-in Lua table entries need to be keyed/indexed by the following:
Not all of the above key entries need to be in the table. The 'version' entry is required, however. The others are not currently used for anything, but might be in the future and thus using them might be useful. Table entries keyed by other strings are ignored, and do not cause an error.
local my_info = { version = "1.0.1", author = "Jane Doe", repository = "https://github.com/octocat/Spoon-Knife" } set_plugin_info(my_info)
Since: 1.99.8
Formats an absolute timestamp into a human readable date.
A string with the formated date
Formats a relative timestamp in a human readable time.
A string with the formated time
Get a preference value. @since 3.5.0
The preference value, or nil if not found.
Set a preference value. @since 3.5.0
true if changed, false if unchanged or nil if not found.
Reset a preference to default value. @since 3.5.0
true if valid preference
Loads a Lua file and compiles it into a Lua chunk, similar to the standard loadfile but searches additional directories. The search order is the current directory, followed by the user’s personal configuration directory, and finally the global configuration directory.
-- Assume foo.lua contains definition for foo(a,b). Load the chunk -- from the file and execute it to add foo(a,b) to the global table. -- These two lines are effectively the same as dofile('foo.lua'). local loaded_chunk = assert(loadfile('foo.lua')) loaded_chunk() -- ok to call foo at this point foo(1,2)
Loads a Lua file and executes it as a Lua chunk, similar to the standard dofile but searches additional directories. The search order is the current directory, followed by the user’s personal configuration directory, and finally the global configuration directory.