From 026f2be3791231db3b70150e180c7d0078f0f77c Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Wed, 30 Oct 2024 12:16:21 +0000 Subject: [PATCH] Bootstrap packer --- config/packages/neovim/init.lua | 41 ++++++++++++++++++++++++-- config/packages/neovim/lua/plugins.lua | 25 ---------------- 2 files changed, 39 insertions(+), 27 deletions(-) delete mode 100644 config/packages/neovim/lua/plugins.lua diff --git a/config/packages/neovim/init.lua b/config/packages/neovim/init.lua index 06cbfd7..bf89820 100644 --- a/config/packages/neovim/init.lua +++ b/config/packages/neovim/init.lua @@ -1,5 +1,3 @@ -lua require("plugins") - -- Leader key vim.g.mapleader = " " @@ -205,3 +203,42 @@ vim.api.nvim_set_keymap('v', 'pf', ':CopilotChatFix', { noremap = tr vim.api.nvim_set_keymap('v', 'po', ':CopilotChatOptimize', { noremap = true, silent = true }) vim.api.nvim_set_keymap('v', 'pd', ':CopilotChatDocs', { noremap = true, silent = true }) vim.api.nvim_set_keymap('v', 'pt', ':CopilotChatTests', { noremap = true, silent = true }) + +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() + +vim.cmd [[packadd packer.nvim]] + +return require('packer').startup(function(use) + -- Packer can manage itself + use 'wbthomason/packer.nvim' + + -- Plugins + use 'dracula/vim' + use 'ryanoasis/vim-devicons' + -- use 'SirVer/ultisnips' + use 'honza/vim-snippets' + use 'scrooloose/nerdtree' + use 'preservim/nerdcommenter' + use 'mhinz/vim-startify' + use {'neoclide/coc.nvim', branch = 'release'} + use 'nvim-lua/plenary.nvim' + use 'ThePrimeagen/harpoon' + use {'junegunn/fzf', run = function() vim.fn['fzf#install']() end} + use 'junegunn/fzf.vim' + use 'neovim/nvim-lspconfig' + use 'jose-elias-alvarez/null-ls.nvim' + use 'MunifTanjim/prettier.nvim' + use 'github/copilot.vim' + use {'CopilotC-Nvim/CopilotChat.nvim', branch = 'canary'} +end) diff --git a/config/packages/neovim/lua/plugins.lua b/config/packages/neovim/lua/plugins.lua deleted file mode 100644 index 6660012..0000000 --- a/config/packages/neovim/lua/plugins.lua +++ /dev/null @@ -1,25 +0,0 @@ -vim.cmd [[packadd packer.nvim]] - -return require('packer').startup(function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' - - -- Plugins - use 'dracula/vim' - use 'ryanoasis/vim-devicons' - -- use 'SirVer/ultisnips' - use 'honza/vim-snippets' - use 'scrooloose/nerdtree' - use 'preservim/nerdcommenter' - use 'mhinz/vim-startify' - use {'neoclide/coc.nvim', branch = 'release'} - use 'nvim-lua/plenary.nvim' - use 'ThePrimeagen/harpoon' - use {'junegunn/fzf', run = function() vim.fn['fzf#install']() end} - use 'junegunn/fzf.vim' - use 'neovim/nvim-lspconfig' - use 'jose-elias-alvarez/null-ls.nvim' - use 'MunifTanjim/prettier.nvim' - use 'github/copilot.vim' - use {'CopilotC-Nvim/CopilotChat.nvim', branch = 'canary'} -end)