Reload `init.lua` and all `require`d scripts

Not sure why you would want to check for all the loaded files, since the only files that needed to be reloaded would be your own config. At this point unfortunately, you will have to re-source the way I mentioned or via plenary of you have files inside lua/ directory in your user config.

But if you insist, then you can always debug with the print command and vim.inspect and see the output is. In this case, running in nvim:

:lua print(vim.inspect(package.loaded, { depth = 1 }))

Will print out all the packages/modules loaded from nvim and your init.lua.

Now to know EXACTLY which packages were loaded from your init.lua? Well… you can always look into your init.lua file and grep for all the require code that’s in there.