nvim中packer.lua的设置

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
})
复制代码

 

posted on   风中狂笑  阅读(213)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示