Closed erf closed 4 years ago
You can use the standard Lua package.path
, it is also used to produce the :help Lua
listing.
As was explained in #813, the first path which contains the requested file is used.
More concretely, you can use package.searchpath
:
local path, err = package.searchpath("visrc", package.path)
if err then
-- not found
else
-- do something with path
end
Thanks!
Ok, this might be weird, but would it be possible to make a command line script ( bash or lua ) somehow get the default visrc.lua
path; perhaps by running a command / pipe via vis ?
I'd like to have the current Lua runtime path, used to source the visrc.lua, available via the Lua API.
I require a Lua plugin, which would like to do some disk operations on the current path.