config.nvim/lua/lazy-plugins.lua

178 lines
3.1 KiB
Lua
Raw Normal View History

2023-10-31 14:21:12 +08:00
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)
2023-11-11 10:22:57 +08:00
local opts = {
2023-10-31 14:21:12 +08:00
install = {
colorscheme = { "gruvbox" }
}
}
2023-11-11 10:22:57 +08:00
local plugins = {
2023-11-11 11:45:14 +08:00
-- main UI
2023-10-31 14:21:12 +08:00
{
"ellisonleao/gruvbox.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd([[colorscheme gruvbox]])
end
},
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("plugins.statusline")
end
},
2023-11-11 11:45:14 +08:00
-- TS, LSP, Completion
2023-10-31 14:21:12 +08:00
{
"williamboman/mason.nvim"
},
{
2023-11-11 11:45:14 +08:00
"nvim-treesitter/nvim-treesitter",
config = function()
require("plugins.treesitter")
end
2023-10-31 14:21:12 +08:00
},
{
2023-11-11 11:45:14 +08:00
"nvim-treesitter/nvim-treesitter-context",
2023-10-31 14:21:12 +08:00
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
},
{
"hrsh7th/nvim-cmp",
dependencies = {
{
"hrsh7th/cmp-nvim-lsp",
},
-- TODO: check the cmp sources
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-nvim-lsp-document-symbol",
"FelipeLema/cmp-async-path",
"petertriho/cmp-git",
"ray-x/cmp-treesitter",
{
"saadparwaiz1/cmp_luasnip",
dependencies = {
"L3MON4D3/LuaSnip"
}
},
{
"windwp/nvim-autopairs",
config = function()
require("plugins.nvim-autopairs")
end
}
},
event = { "InsertEnter", "CmdlineEnter" },
config = function()
require("plugins/cmp")
end
},
{
"hrsh7th/cmp-nvim-lsp",
dependencies = {
"neovim/nvim-lspconfig",
dependencies = {
{
"williamboman/mason-lspconfig.nvim",
dependencies = {
"williamboman/mason.nvim",
}
},
"null-ls.nvim"
},
config = function()
require("plugins.lsp")
end,
}
},
{
"jay-babu/mason-null-ls.nvim",
config = function()
require("plugins.null-ls")
end,
dependencies = {
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim"
}
},
2023-11-11 11:45:14 +08:00
-- Code editing
{
"machakann/vim-sandwich",
keys = "s"
},
2023-11-11 10:22:57 +08:00
{
"numToStr/Comment.nvim",
2023-11-11 11:45:14 +08:00
keys = "g",
config = function()
2023-11-11 10:22:57 +08:00
require("Comment").setup()
end
},
2023-11-11 11:45:14 +08:00
{
"andymass/vim-matchup",
event = "BufEnter"
},
2023-10-31 14:21:12 +08:00
{
"nvim-telescope/telescope.nvim",
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require("plugins.telescope")
end
},
2023-11-11 11:45:14 +08:00
-- Eye candy UI
2023-10-31 14:21:12 +08:00
{
"winston0410/range-highlight.nvim",
event = "CmdlineEnter"
2023-11-11 11:45:14 +08:00
},
{
'simrat39/symbols-outline.nvim',
cmd = { 'SymbolsOutline', 'SymbolsOutlineOpen' },
opts = { autofold_depth = 12 }
},
{
'stevearc/dressing.nvim'
},
{
"lewis6991/gitsigns.nvim",
event = "BufEnter",
config = function()
require('gitsigns').setup()
end
2023-10-31 14:21:12 +08:00
}
2023-11-11 10:22:57 +08:00
}
local vscode_plugins = {
"machakann/vim-sandwich",
{
"numToStr/Comment.nvim",
event = "BufEnter",
2023-11-11 11:45:14 +08:00
config = function()
2023-11-11 10:22:57 +08:00
require("Comment").setup()
end
},
}
if vim.g.vscode then
-- VSCode extension
require("lazy").setup(vscode_plugins, opts)
else
-- ordinary Neovim
require("lazy").setup(plugins, opts)
end