Skip to content

Commit 57e65e1

Browse files
committed
fix(nvim): lazy bootstrap
1 parent 2910567 commit 57e65e1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.config/nvim/lua/diaoul/config/lazy.lua

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1+
-- bootstrap lazy.nvim
12
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2-
if not vim.loop.fs_stat(lazypath) then
3-
-- bootstrap lazy.nvim
3+
if not vim.uv.fs_stat(lazypath) then
4+
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
45
-- stylua: ignore
5-
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
6+
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
7+
if vim.v.shell_error ~= 0 then
8+
vim.api.nvim_echo({
9+
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
10+
{ out, "WarningMsg" },
11+
{ "\nPress any key to exit..." },
12+
}, true, {})
13+
vim.fn.getchar()
14+
os.exit(1)
15+
end
616
end
717
vim.opt.rtp:prepend(lazypath)
818

19+
-- setup lazy.nvim
920
require("lazy").setup({
1021
spec = {
1122
{ import = "diaoul.plugins" },

0 commit comments

Comments
 (0)