diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 27290873a3f..4c19dcb6f00 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -5,7 +5,7 @@ -- Iterate over all Lua files in the plugins directory and load them. -- `vim.fs.dir()` iteration order is unspecified and must not be relied upon. -local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins') +local plugins_dir = vim.fs.dirname(debug.getinfo(1, 'S').source:sub(2)) for file_name, type in vim.fs.dir(plugins_dir, { follow = true }) do if (type == 'file' or type == 'link') and file_name:match '%.lua$' and file_name ~= 'init.lua' then local module = file_name:gsub('%.lua$', '')