Skip to content

Commit aa0c6bd

Browse files
committed
Make the custom.plugins loading cross-platform
1 parent 0301fb3 commit aa0c6bd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lua/custom/plugins/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
-- See the kickstart.nvim README for more information
55

66
-- Iterate over all Lua files in the plugins directory and load them
7-
local plugins_dir = vim.fn.stdpath 'config' .. '/lua/custom/plugins'
8-
for _, file in ipairs(vim.fn.readdir(plugins_dir)) do
9-
if file:match '%.lua$' and file ~= 'init.lua' then
10-
local module = file:gsub('%.lua$', '')
7+
local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins')
8+
for file_name, type in vim.fs.dir(plugins_dir) do
9+
if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then
10+
local module = file_name:gsub('%.lua$', '')
1111
require('custom.plugins.' .. module)
1212
end
1313
end

0 commit comments

Comments
 (0)