option full_feature, false when not need much plugin

This commit is contained in:
leafee98 2023-05-22 22:33:21 +08:00
parent 1d2561beae
commit 80b82caf95
6 changed files with 72 additions and 48 deletions

View file

@ -24,6 +24,8 @@ vim.keymap.set("n", "<F3>", "<cmd>bdelete<CR>", { silent = true })
vim.g.mapleader = " " vim.g.mapleader = " "
vim.g.maplocalleader = " " vim.g.maplocalleader = " "
full_feature = false
-- Use lazy.nvim as plugin manager, and load plugin's config -- Use lazy.nvim as plugin manager, and load plugin's config
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then

View file

@ -9,6 +9,7 @@ return {
}, },
{ {
"karb94/neoscroll.nvim", "karb94/neoscroll.nvim",
enabled = full_feature,
main = "neoscroll", main = "neoscroll",
opts = { }, opts = { },
}, },
@ -22,6 +23,7 @@ return {
}, },
{ {
"akinsho/bufferline.nvim", "akinsho/bufferline.nvim",
enabled = full_feature,
main = "bufferline", main = "bufferline",
opts = { opts = {
options = { options = {
@ -45,6 +47,7 @@ return {
}, },
{ {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
enabled = full_feature,
dependencies = { dependencies = {
"nvim-tree/nvim-web-devicons" "nvim-tree/nvim-web-devicons"
}, },
@ -56,6 +59,7 @@ return {
}, },
{ {
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
enabled = full_feature,
dependencies = { dependencies = {
"nvim-tree/nvim-web-devicons" "nvim-tree/nvim-web-devicons"
}, },

View file

@ -1,6 +1,7 @@
return { return {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
main = "gitsigns", main = "gitsigns",
enabled = full_feature,
opts = { opts = {
on_attach = function(bufnr) on_attach = function(bufnr)
local gs = package.loaded.gitsigns local gs = package.loaded.gitsigns

View file

@ -0,0 +1,64 @@
local full_ensure = {
"bash",
"c",
"cmake",
"cpp",
"css",
"diff",
"dockerfile",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"go",
"gomod",
"gosum",
"html",
"java",
"javascript",
"json",
"json5",
"jsonc",
"lua",
"luadoc",
"luau",
"make",
"markdown",
"markdown_inline",
"python",
"rust",
"scss",
"sql",
"toml",
"vim",
"vimdoc",
"yaml"
}
local basic_ensure = {
"toml",
"json",
"json5",
"jsonc",
"yaml",
}
if full_feature then
ensure = full_ensure
else
ensure = basic_ensure
end
return {
"nvim-treesitter/nvim-treesitter",
main = "nvim-treesitter.configs",
build = ":TSUpdate",
opts = {
indent = { enable = true },
highlight = { enable = true },
ensure_installed = ensure,
auto_install = true,
sync_install = false,
},
}

View file

@ -39,6 +39,7 @@ end
return { return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
enabled = full_feature,
dependencies = { dependencies = {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",

View file

@ -1,48 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
main = "nvim-treesitter.configs",
build = ":TSUpdate",
opts = {
indent = { enable = true },
highlight = { enable = true },
ensure_installed = {
"bash",
"c",
"cmake",
"cpp",
"css",
"diff",
"dockerfile",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"go",
"gomod",
"gosum",
"html",
"java",
"javascript",
"json",
"json5",
"jsonc",
"lua",
"luadoc",
"luau",
"make",
"markdown",
"markdown_inline",
"python",
"rust",
"scss",
"sql",
"toml",
"vim",
"vimdoc",
"yaml"
},
auto_install = true,
sync_install = false,
},
}