Manu`s website | Configure Nvim with Lua: Plugin/package management (3) (manujsdev.com)
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([[ augroup packer_user_config autocmd! autocmd BufWritePost plugins.lua source <afile> | PackerCompile augroup end ]]) local ok, packer = pcall(require, 'packer') if not ok then print "packer is not loaded" return else print "packer is loaded" end packer.init({ display = { open_fn = function() return require('packer.util').float({ border = 'rounded' }) -- Using a floating window end } }) return packer.startup({ function() use {'wbthomason/packer.nvim'} use {'lewis6991/impatient.nvim'} use {'nvim-lua/popup.nvim'} use {'nvim-lua/plenary.nvim'} use {'windwp/nvim-autopairs'} use {'numToStr/Comment.nvim'} -- 你的插件列表... use {'neoclide/coc.nvim', branch = 'release'} -- nvim-tree use { "kyazdani42/nvim-tree.lua", requires = {"kyazdani42/nvim-web-devicons"}, } -- bufferline use { "akinsho/bufferline.nvim", requires = {{"nvim-tree/nvim-web-devicons"}, {"moll/vim-bbye" }}, } -- lualine use { "nvim-lualine/lualine.nvim", requires = { "nvim-tree/nvim-web-devicons" }, } use {"arkav/lualine-lsp-progress"} -- telescope use { "nvim-telescope/telescope.nvim", requires = { "nvim-lua/plenary.nvim" }, } -- telescope extensions use {"LinArcX/telescope-env.nvim"} use {"nvim-telescope/telescope-ui-select.nvim"} -- dashboard-nvim use { 'glepnir/dashboard-nvim', -- event = 'VimEnter', config = function() require('dashboard').setup { config } end, requires = {'nvim-tree/nvim-web-devicons'} } -- project use {"ahmedkhalf/project.nvim"} -- treesitter use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", } use {"p00f/nvim-ts-rainbow"} -- indent-blankline use {"lukas-reineke/indent-blankline.nvim"} -- 代码格式化 use {"mhartington/formatter.nvim"} use {"jose-elias-alvarez/null-ls.nvim", requires = {"nvim-lua/plenary.nvim" }} -- gruvbox use { "ellisonleao/gruvbox.nvim", requires = { "rktjmp/lush.nvim" }, } -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if packer_bootstrap then require('packer').sync() end end })
标签:use,end,packer,lua,--,nvim From: https://www.cnblogs.com/dogingate/p/17437369.html