We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0301fb3 commit aa0c6bdCopy full SHA for aa0c6bd
1 file changed
lua/custom/plugins/init.lua
@@ -4,10 +4,10 @@
4
-- See the kickstart.nvim README for more information
5
6
-- 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$', '')
+local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins')
+for file_name, type in vim.fs.dir(plugins_dir) do
+ if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then
+ local module = file_name:gsub('%.lua$', '')
11
require('custom.plugins.' .. module)
12
end
13
0 commit comments