notes/config/nvim/lua/neo/lazy.lua

288 lines
5.8 KiB
Lua

-- stdpath('config') returns $HOME/.config/nvim
-- stdpath('data') returns $HOME/.local/share/nvim
-- Default lazypath
-- local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
local config_path = vim.fn.stdpath('config')
local lazyroot = config_path .. '/nvim'
local lazypath = config_path .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://mirror.ghproxy.com/https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
local lazyopts = {
defaults = {
lazy = false,
},
-- TODO: 使用一段时间,没啥问题就删掉
-- spec = {
-- -- add LazyVim and import its plugins
-- { "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- -- import any extras modules here
-- -- { import = "lazyvim.plugins.extras.lang.typescript" },
-- -- { import = "lazyvim.plugins.extras.lang.json" },
-- -- { import = "lazyvim.plugins.extras.ui.mini-animate" },
-- -- import/override with your plugins
-- { import = "plugins" },
-- },
git = {
-- defaults for the `Lazy log` command
-- log = { "-10" }, -- show the last 10 commits
log = { "-8" }, -- show commits from the last 3 days
timeout = 120, -- kill processes that take more than 2 minutes
url_format = "https://mirror.ghproxy.com/https://github.com/%s.git",
-- lazy.nvim requires git >=2.19.0. If you really want to use lazy with an older version,
-- then set the below to false. This should work, but is NOT supported and will
-- increase downloads a lot.
filter = true,
},
}
local plugins = {
{
"hrsh7th/nvim-cmp",
-- load cmp on InsertEnter
event = "InsertEnter",
-- these dependencies will only be loaded when cmp loads
-- dependencies are always lazy-loaded unless specified otherwise
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
},
},
{
"nvim-lua/plenary.nvim",
lazy = false,
},
{
"ahmedkhalf/project.nvim",
lazy = false,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
lazy = false,
},
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
},
{
"williamboman/mason.nvim",
lazy = false,
},
{
"williamboman/mason-lspconfig.nvim",
lazy = false,
},
{
"nvimdev/lspsaga.nvim",
lazy = false,
},
{
"neovim/nvim-lspconfig",
lazy = false,
},
{
"nvim-lualine/lualine.nvim",
lazy = false,
},
{
"akinsho/bufferline.nvim",
lazy = false,
},
{
"kyazdani42/nvim-tree.lua",
lazy = false,
},
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {},
lazy = false,
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
lazy = false,
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
lazy = false,
},
{
"phaazon/hop.nvim",
lazy = false,
},
{
"folke/trouble.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
lazy = false,
},
{
"ishan9299/nvim-solarized-lua",
lazy = false,
},
{
"ray-x/go.nvim",
},
{
"simrat39/rust-tools.nvim",
ft = "rust",
lazy = true,
},
{
"HiPhish/nvim-ts-rainbow2",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
},
{
"HiPhish/rainbow-delimiters.nvim",
lazy = false,
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
},
{
'numToStr/Comment.nvim',
opts = {
-- add any options here
},
lazy = false,
},
{
"f-person/git-blame.nvim",
},
{
"lewis6991/gitsigns.nvim",
config = function()
require('gitsigns').setup()
end
},
{
"goolord/alpha-nvim",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
},
{
"rafamadriz/friendly-snippets",
},
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets",
}
},
{
"hrsh7th/nvim-cmp",
},
{
"hrsh7th/cmp-path",
},
{
"hrsh7th/cmp-buffer",
},
-- {
-- "saadparwaiz1/cmp_luasnip",
-- },
{
"hrsh7th/cmp-nvim-lsp",
},
{
"hrsh7th/cmp-nvim-lua",
},
{
"Vonr/align.nvim",
branch = "v2",
lazy = true,
init = function()
-- Create your mappings here
end
},
}
require("lazy").setup(plugins, lazyopts)
-- require("lazy").setup({
-- defaults = {
-- -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
-- lazy = false,
-- -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- -- have outdated releases, which may break your Neovim install.
-- version = false, -- always use the latest git commit
-- -- version = "*", -- try installing the latest stable version for plugins that support semver
-- },
--
-- install = { colorscheme = { "tokyonight", "habamax" } },
-- checker = { enabled = true }, -- automatically check for plugin updates
-- performance = {
-- rtp = {
-- -- disable some rtp plugins
-- disabled_plugins = {
-- "gzip",
-- -- "matchit",
-- -- "matchparen",
-- -- "netrwPlugin",
-- "tarPlugin",
-- "tohtml",
-- "tutor",
-- "zipPlugin",
-- },
-- },
-- },
--
-- })