Skip to content

Commit

Permalink
fix: Fix script to install lazy.nvim (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpriscella authored Sep 12, 2024
1 parent 8099e2d commit 7f42a23
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
-- Help can also be found by running `:help lua`.
-- Neovim uses Lua 5.1. Reference manual can be found here: https://www.lua.org/manual/5.1

-- Initialize lazy.nvim package manager.
-- Bootstrap lazy.nvim.
-- https://github.com/folke/lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--depth 1",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)

Expand Down

0 comments on commit 7f42a23

Please sign in to comment.