vim: show warning instead of error if lazy can't be bootstrapped

This commit is contained in:
Fernando Schauenburg 2023-08-09 16:35:07 +02:00
parent 48864a8983
commit a8cae3438e

View file

@ -1,4 +1,4 @@
local get_lazy = function() local lazy = (function()
local path = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' local path = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(path) then if not vim.loop.fs_stat(path) then
vim.fn.system { vim.fn.system {
@ -12,11 +12,11 @@ local get_lazy = function()
end end
vim.opt.rtp:prepend(path) vim.opt.rtp:prepend(path)
return vim.F.npcall(require, 'lazy') return vim.F.npcall(require, 'lazy')
end end)()
local lazy = get_lazy()
if lazy then if lazy then
lazy.setup('fschauen.plugins', { lazy.setup {
spec = 'fschauen.plugins',
dev = { dev = {
path = '~/Projects/nvim-plugins', path = '~/Projects/nvim-plugins',
fallback = true, fallback = true,
@ -24,8 +24,8 @@ if lazy then
ui = { ui = {
border = 'rounded', border = 'rounded',
}, },
}) }
else else
vim.notify('Lazy not installed and failed to bootstrap!', vim.log.levels.ERROR) vim.notify('Lazy not installed and failed to bootstrap!', vim.log.levels.WARN)
end end