vim: move lazy config to its own file
This commit is contained in:
parent
b4056586a2
commit
fc731f1d63
2 changed files with 30 additions and 20 deletions
|
@ -6,24 +6,5 @@ require 'user.options'
|
|||
require 'user.keymap'
|
||||
require 'user.autocmds'
|
||||
require 'user.filetypes'
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system {
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
}
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require('lazy').setup('user.plugins', {
|
||||
dev = {
|
||||
path = '~/Projects/nvim-plugins',
|
||||
fallback = true,
|
||||
},
|
||||
})
|
||||
require 'user.lazy'
|
||||
|
||||
|
|
29
config/nvim/lua/user/lazy.lua
Normal file
29
config/nvim/lua/user/lazy.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
local get_lazy = function()
|
||||
local path = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(path) then
|
||||
vim.fn.system {
|
||||
'git',
|
||||
'clone',
|
||||
'--filter=blob:none',
|
||||
'--branch=stable',
|
||||
'https://github.com/folke/lazy.nvim.git',
|
||||
path,
|
||||
}
|
||||
end
|
||||
vim.opt.rtp:prepend(path)
|
||||
local _, lazy = pcall(require, 'lazy')
|
||||
return lazy
|
||||
end
|
||||
|
||||
local lazy = get_lazy()
|
||||
if lazy then
|
||||
lazy.setup('user.plugins', {
|
||||
dev = {
|
||||
path = '~/Projects/nvim-plugins',
|
||||
fallback = true,
|
||||
},
|
||||
})
|
||||
else
|
||||
vim.notify('Lazy not installed and failed to bootstrap!', vim.log.levels.ERROR)
|
||||
end
|
||||
|
Loading…
Add table
Reference in a new issue