-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugins-setup.lua
78 lines (65 loc) · 2.33 KB
/
plugins-setup.lua
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
-- 自动安装packer插件管理器
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()
-- 保存此文件自动更新安装软件
-- 注意PackerCompile改成了PackerSync
-- plugins.lua改成了plugins-setup.lua,适应本地文件名字
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins-setup.lua source <afile> | PackerSync
augroup end
]])
return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
---------------------------------------------------------------------------------
use 'folke/tokyonight.nvim' -- 主题
use {
'nvim-lualine/lualine.nvim', -- 状态栏
requires = { 'kyazdani42/nvim-web-devicons', opt = true } -- 状态栏图标
}
use {
'nvim-tree/nvim-tree.lua', -- 文档树
requires = {
'nvim-tree/nvim-web-devicons', -- 文档树图标
}
}
use "christoomey/vim-tmux-navigator" -- 用ctl-hjkl来定位窗口
use "nvim-treesitter/nvim-treesitter" -- 语法高亮
use "p00f/nvim-ts-rainbow" -- 配合treesitter,不同括号颜色区分
-- lsp language syntax tips
use {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", -- 这个相当于mason.nvim和lspconfig的桥梁
"neovim/nvim-lspconfig"
}
-- 自动补全
use "hrsh7th/nvim-cmp"
use "hrsh7th/cmp-nvim-lsp"
use "L3MON4D3/LuaSnip" -- snippets引擎,不装这个自动补全会出问题
use "saadparwaiz1/cmp_luasnip"
use "rafamadriz/friendly-snippets"
use "hrsh7th/cmp-path" -- 文件路径
use "numToStr/Comment.nvim" -- gcc和gc注释
use "windwp/nvim-autopairs" -- 自动补全括号
use "akinsho/bufferline.nvim" -- buffer分割线
use "lewis6991/gitsigns.nvim" -- 左则git提示
use {
'nvim-telescope/telescope.nvim', -- 文件检索
requires = { {'nvim-lua/plenary.nvim'} }
}
use "folke/neodev.nvim"
---------------------------------------------------------------------------------
if packer_bootstrap then
require('packer').sync()
end
end)