feat: Add localRequire fn
This commit is contained in:
parent
123dfb81f9
commit
e9902fad73
1 changed files with 11 additions and 0 deletions
11
nvim/lua/lib/marleyvim/init.lua
Normal file
11
nvim/lua/lib/marleyvim/init.lua
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
---@param prefix string The string to prefix to all req calls.
|
||||||
|
function M.localRequire(prefix)
|
||||||
|
---@param mod string The module to require.
|
||||||
|
return function(mod)
|
||||||
|
return require(prefix .. '.' .. mod)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
Loading…
Reference in a new issue