Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 43 additions & 58 deletions 完整配置代码/nvim/lua/plugins/plugins-setup.lua
Original file line number Diff line number Diff line change
@@ -1,68 +1,53 @@
-- 自动安装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
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

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
]])
local plugins = {
"folke/tokyonight.nvim", -- 主题
"nvim-lualine/lualine.nvim", -- 状态栏
"nvim-tree/nvim-tree.lua", -- 文档树
"nvim-tree/nvim-web-devicons", -- 文档树图标

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,不同括号颜色区分
use {
"christoomey/vim-tmux-navigator", -- 用ctl-hjkl来定位窗口
"nvim-treesitter/nvim-treesitter", -- 语法高亮
"p00f/nvim-ts-rainbow", -- 配合treesitter,不同括号颜色区分

{
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", -- 这个相当于mason.nvim和lspconfig的桥梁
"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" -- 文件路径
},

-- 自动补全
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp",
"L3MON4D3/LuaSnip", -- snippets引擎,不装这个自动补全会出问题
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
"hrsh7th/cmp-path", -- 文件路径

"numToStr/Comment.nvim", -- gcc和gc注释
"windwp/nvim-autopairs", -- 自动补全括号

use "numToStr/Comment.nvim" -- gcc和gc注释
use "windwp/nvim-autopairs" -- 自动补全括号
"akinsho/bufferline.nvim", -- buffer分割线
"lewis6991/gitsigns.nvim", -- 左则git提示

use "akinsho/bufferline.nvim" -- buffer分割线
use "lewis6991/gitsigns.nvim" -- 左则git提示
{
'nvim-telescope/telescope.nvim', tag = '0.1.1', -- 文件检索
dependencies = { {'nvim-lua/plenary.nvim'} } -- requires要改为dependencies
},

use {
'nvim-telescope/telescope.nvim', tag = '0.1.1', -- 文件检索
requires = { {'nvim-lua/plenary.nvim'} }
}
}
local opts = {} -- 注意要定义这个变量

if packer_bootstrap then
require('packer').sync()
end
end)
require("lazy").setup(plugins, opts)
68 changes: 68 additions & 0 deletions 完整配置代码/nvim/lua/plugins/plugins-setup.lua.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
-- 自动安装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,不同括号颜色区分
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', tag = '0.1.1', -- 文件检索
requires = { {'nvim-lua/plenary.nvim'} }
}

if packer_bootstrap then
require('packer').sync()
end
end)
2 changes: 1 addition & 1 deletion 完整配置代码/nvim/lua/plugins/treesitter.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require'nvim-treesitter.configs'.setup {
-- 添加不同语言
ensure_installed = { "vim", "help", "bash", "c", "cpp", "javascript", "json", "lua", "python", "typescript", "tsx", "css", "rust", "markdown", "markdown_inline" }, -- one of "all" or a list of languages
ensure_installed = { "vim", "vimdoc", "bash", "c", "cpp", "javascript", "json", "lua", "python", "typescript", "tsx", "css", "rust", "markdown", "markdown_inline" }, -- one of "all" or a list of languages

highlight = { enable = true },
indent = { enable = true },
Expand Down
210 changes: 0 additions & 210 deletions 完整配置代码/nvim/plugin/packer_compiled.lua

This file was deleted.