You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- 检查是否已存在
if not (vim.uv or vim.loop).fs_stat(lazypath) then
print("未找到 lazy.nvim,正在克隆仓库...")
-- 执行 git clone
local clone_cmd = {"git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath}
local result = vim.fn.system(clone_cmd)
if vim.v.shell_error ~= 0 then
vim.api.nvim_err_writeln("Git 克隆失败!错误信息:\n" .. result)
os.exit(1)
end
print("✅ lazy.nvim 克隆成功!")
else
print("✅ lazy.nvim 已存在。")
end
-- 尝试加载 lazy 模块并设置(这是关键验证)
print("正在尝试加载 lazy 模块...")
local ok, lazy = pcall(require, "lazy")
if not ok then
vim.api.nvim_err_writeln("❌ 加载 lazy 模块失败: " .. lazy)
os.exit(1)
end
print("✅ lazy 模块加载成功。")
Activity
Beapoe commentedon Feb 9, 2026
Copy all the code and paste it into terminal.
Then run it