mappings|init: Move init mappings to a function, only call when required | Show err message for init

because mappings.lua is called from multiple places, so there should't be any code that executes without calling a specific function

show error message when something fails in init.lua
makes no sense to not

rearrange plugin functions alphabetically, but keep misc at top
This commit is contained in:
Akianonymus 2021-08-19 08:45:59 +05:30 committed by siduck76
parent e3f0429a72
commit 02f0122ab4
2 changed files with 119 additions and 115 deletions

View file

@ -4,5 +4,9 @@ local chad_modules = {
}
for i = 1, #chad_modules, 1 do
pcall(require, chad_modules[i])
if not pcall(require, chad_modules[i]) then
error("Error loading " .. chad_modules[i] .. "\n")
end
end
require("mappings").misc()