Simplify structure for nvim config files
This commit is contained in:
		
							
								
								
									
										29
									
								
								src_files/.config/nvim/lua/plugin_manager.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src_files/.config/nvim/lua/plugin_manager.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
-- TODO: maybe switch this over from git-clone approach to neovim's builtin vim.pack.add
 | 
			
		||||
local path_lazy_nvim = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
 | 
			
		||||
if not vim.loop.fs_stat(path_lazy_nvim) then
 | 
			
		||||
  local git_output = vim.fn.system({
 | 
			
		||||
    "git",
 | 
			
		||||
    "clone",
 | 
			
		||||
    "--filter=blob:none",
 | 
			
		||||
    "https://github.com/folke/lazy.nvim.git",
 | 
			
		||||
    "--branch=stable",
 | 
			
		||||
    path_lazy_nvim,
 | 
			
		||||
  })
 | 
			
		||||
  if vim.v.shell_error ~= 0 then
 | 
			
		||||
    vim.api.nvim_echo(
 | 
			
		||||
      { { "Failed to clone lazy.nvim:\n" }, { git_output }, },
 | 
			
		||||
      true,
 | 
			
		||||
      {}
 | 
			
		||||
    )
 | 
			
		||||
    vim.fn.getchar()
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
vim.opt.rtp:prepend(path_lazy_nvim)
 | 
			
		||||
 | 
			
		||||
require("lazy").setup({
 | 
			
		||||
    spec = {
 | 
			
		||||
      { import = "plugins_lazy" },
 | 
			
		||||
    },
 | 
			
		||||
    checker = { enabled = false },
 | 
			
		||||
    change_detection = { notify = false },
 | 
			
		||||
})
 | 
			
		||||
		Reference in New Issue
	
	Block a user