Modified to ensure Packer installed
This commit is contained in:
		@ -40,7 +40,7 @@ require'lspconfig'.gdscript.setup{}
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
require('mason').setup({})
 | 
					require('mason').setup({})
 | 
				
			||||||
require('mason-lspconfig').setup({
 | 
					require('mason-lspconfig').setup({
 | 
				
			||||||
	ensure_installed = {'tsserver', 'eslint', 'rust_analyzer', 'gopls'},
 | 
						ensure_installed = {'rust_analyzer', 'gopls'},
 | 
				
			||||||
	handlers = {
 | 
						handlers = {
 | 
				
			||||||
		lsp.default_setup,
 | 
							lsp.default_setup,
 | 
				
			||||||
		lua_ls = function()
 | 
							lua_ls = function()
 | 
				
			||||||
 | 
				
			|||||||
@ -1,2 +1,4 @@
 | 
				
			|||||||
 | 
					require("nefrace.packerensure")
 | 
				
			||||||
 | 
					require("nefrace.packer")
 | 
				
			||||||
require("nefrace.remap")
 | 
					require("nefrace.remap")
 | 
				
			||||||
require("nefrace.set")
 | 
					require("nefrace.set")
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										25
									
								
								lua/nefrace/packerensure.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								lua/nefrace/packerensure.lua
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					local ensure_packer = function()
 | 
				
			||||||
 | 
					  local fn = vim.fn
 | 
				
			||||||
 | 
					  local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
 | 
				
			||||||
 | 
					  if fn.empty(fn.glob(install_path)) > 0 then
 | 
				
			||||||
 | 
					    fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
 | 
				
			||||||
 | 
					    vim.cmd [[packadd packer.nvim]]
 | 
				
			||||||
 | 
					    return true
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					  return false
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local packer_bootstrap = ensure_packer()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					return require('nefrace.packer').startup(function(use)
 | 
				
			||||||
 | 
					  use 'wbthomason/packer.nvim'
 | 
				
			||||||
 | 
					  -- My plugins here
 | 
				
			||||||
 | 
					  -- use 'foo1/bar1.nvim'
 | 
				
			||||||
 | 
					  -- use 'foo2/bar2.nvim'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  -- Automatically set up your configuration after cloning packer.nvim
 | 
				
			||||||
 | 
					  -- Put this at the end after all plugins
 | 
				
			||||||
 | 
					  if packer_bootstrap then
 | 
				
			||||||
 | 
					    require('nefrace.packer').sync()
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					end)
 | 
				
			||||||
		Reference in New Issue
	
	Block a user