chore(nvim): clean config
This commit is contained in:
32
.config/nvim/lua/BluePlum/lazy.lua
Normal file
32
.config/nvim/lua/BluePlum/lazy.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
--- @class Lazy
|
||||
--- @field setup fun(opts: table)
|
||||
|
||||
local M = {}
|
||||
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
|
||||
--- @nodiscard
|
||||
--- @return Lazy?
|
||||
function M.bootstrap()
|
||||
--- @type { fs_stat: fun(path: string): boolean }
|
||||
local fs = vim.uv or vim.loop
|
||||
if fs.fs_stat(lazypath) then
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
return require('lazy')
|
||||
end
|
||||
|
||||
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' },
|
||||
}, true, {})
|
||||
return nil
|
||||
end
|
||||
|
||||
return require('lazy')
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user