Make the custom.plugins loading cross-platform

This commit is contained in:
orip 2026-05-04 21:08:04 +03:00
parent f9b6223918
commit c227278c56

View File

@ -4,10 +4,10 @@
-- See the kickstart.nvim README for more information -- See the kickstart.nvim README for more information
-- Iterate over all Lua files in the plugins directory and load them -- Iterate over all Lua files in the plugins directory and load them
local plugins_dir = vim.fn.stdpath 'config' .. '/lua/custom/plugins' local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins')
for _, file in ipairs(vim.fn.readdir(plugins_dir)) do for file_name, type in vim.fs.dir(plugins_dir) do
if file:match '%.lua$' and file ~= 'init.lua' then if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then
local module = file:gsub('%.lua$', '') local module = file_name:gsub('%.lua$', '')
require('custom.plugins.' .. module) require('custom.plugins.' .. module)
end end
end end