ref(nvim)

This commit is contained in:
thek4n 2024-04-10 14:51:25 +03:00
parent 1d390b22ae
commit 334641d263
2 changed files with 8 additions and 5 deletions

View File

@ -1,10 +1,11 @@
for _, source in ipairs { for _, source in ipairs({
"base.options", "base.options",
"base.mappings", "base.mappings",
"base.lazy", "base.lazy",
} do })
do
local status_ok, fault = pcall(require, source) local status_ok, fault = pcall(require, source)
if not status_ok then if not status_ok then
vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault) vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault)
end end
end end

View File

@ -20,7 +20,9 @@ local plugins = {}
local modules = vim.split(vim.fn.glob(vim.fn.stdpath("config") .. '/lua/*/plugins/*lua'), '\n') local modules = vim.split(vim.fn.glob(vim.fn.stdpath("config") .. '/lua/*/plugins/*lua'), '\n')
for i, module_path in pairs(modules) do local splitted_path
local module_name
for _, module_path in pairs(modules) do
splitted_path = vim.split(module_path, '/') splitted_path = vim.split(module_path, '/')
module_name = splitted_path[#splitted_path]:gsub(".lua", "") module_name = splitted_path[#splitted_path]:gsub(".lua", "")
@ -33,4 +35,4 @@ require("lazy").setup(
{ {
lockfile = vim.fn.stdpath "data" .. "/lazy-lock.json" lockfile = vim.fn.stdpath "data" .. "/lazy-lock.json"
} }
) )