2023-01-07 08:11:43 +00:00
|
|
|
-- All plugins have lazy=true by default,to load a plugin on startup just lazy=false
|
2022-11-17 01:30:36 +00:00
|
|
|
-- List of all default plugins & their definitions
|
2023-02-17 16:38:28 +00:00
|
|
|
local default_plugins = {
|
2022-05-23 07:24:03 +00:00
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
"nvim-lua/plenary.nvim",
|
2022-09-02 05:35:50 +00:00
|
|
|
|
2023-02-28 03:53:07 +00:00
|
|
|
{
|
|
|
|
"NvChad/base46",
|
2023-10-17 09:55:13 +00:00
|
|
|
branch = "v3.0",
|
2023-02-28 03:53:07 +00:00
|
|
|
build = function()
|
|
|
|
require("base46").load_all_highlights()
|
|
|
|
end,
|
|
|
|
},
|
2022-07-22 16:00:00 +00:00
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"NvChad/ui",
|
2024-02-29 02:30:50 +00:00
|
|
|
branch = "clean",
|
2023-01-07 08:11:43 +00:00
|
|
|
lazy = false,
|
2023-09-27 00:44:48 +00:00
|
|
|
config = function()
|
|
|
|
require "nvchad"
|
|
|
|
end,
|
2022-07-22 16:00:00 +00:00
|
|
|
},
|
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"NvChad/nvim-colorizer.lua",
|
2024-01-28 16:03:38 +00:00
|
|
|
event = "User FilePost",
|
2023-02-19 01:49:01 +00:00
|
|
|
config = function(_, opts)
|
|
|
|
require("colorizer").setup(opts)
|
2023-02-17 16:38:28 +00:00
|
|
|
|
|
|
|
-- execute colorizer as soon as possible
|
|
|
|
vim.defer_fn(function()
|
|
|
|
require("colorizer").attach_to_buffer(0)
|
|
|
|
end, 0)
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"nvim-tree/nvim-web-devicons",
|
|
|
|
opts = function()
|
2023-08-09 14:52:46 +00:00
|
|
|
return { override = require "nvchad.icons.devicons" }
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
2023-02-17 16:38:28 +00:00
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "devicons")
|
|
|
|
require("nvim-web-devicons").setup(opts)
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"lukas-reineke/indent-blankline.nvim",
|
2024-01-28 16:03:38 +00:00
|
|
|
event = "User FilePost",
|
2024-02-25 03:13:48 +00:00
|
|
|
opts = {
|
|
|
|
indent = { char = "│", highlight = "IblChar" },
|
|
|
|
scope = { char = "│", highlight = "IblScopeChar" },
|
|
|
|
},
|
2023-02-17 16:38:28 +00:00
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "blankline")
|
2023-09-28 05:52:12 +00:00
|
|
|
|
|
|
|
local hooks = require "ibl.hooks"
|
|
|
|
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
|
|
|
require("ibl").setup(opts)
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2024-01-28 16:03:38 +00:00
|
|
|
event = { "BufReadPost", "BufNewFile" },
|
2023-02-17 16:38:28 +00:00
|
|
|
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
|
2023-01-26 03:28:44 +00:00
|
|
|
build = ":TSUpdate",
|
2023-02-19 01:49:01 +00:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.treesitter"
|
|
|
|
end,
|
2023-02-17 16:38:28 +00:00
|
|
|
config = function(_, opts)
|
2023-03-26 10:22:41 +00:00
|
|
|
dofile(vim.g.base46_cache .. "syntax")
|
2023-10-28 04:04:28 +00:00
|
|
|
dofile(vim.g.base46_cache .. "treesitter")
|
2023-02-17 16:38:28 +00:00
|
|
|
require("nvim-treesitter.configs").setup(opts)
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- git stuff
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"lewis6991/gitsigns.nvim",
|
2024-01-28 16:03:38 +00:00
|
|
|
event = "User FilePost",
|
2023-02-19 01:49:01 +00:00
|
|
|
opts = function()
|
2024-02-27 07:01:36 +00:00
|
|
|
return require "plugins.configs.gitsigns"
|
2023-02-19 01:49:01 +00:00
|
|
|
end,
|
2023-02-17 16:38:28 +00:00
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "git")
|
|
|
|
require("gitsigns").setup(opts)
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- lsp stuff
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"williamboman/mason.nvim",
|
2023-09-07 16:02:07 +00:00
|
|
|
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
|
2023-02-19 01:49:01 +00:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.mason"
|
|
|
|
end,
|
2023-02-17 16:38:28 +00:00
|
|
|
config = function(_, opts)
|
2023-02-18 08:56:40 +00:00
|
|
|
dofile(vim.g.base46_cache .. "mason")
|
2023-02-17 16:38:28 +00:00
|
|
|
require("mason").setup(opts)
|
2023-02-18 08:56:40 +00:00
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
-- custom nvchad cmd to install all mason binaries listed
|
|
|
|
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
2023-12-27 14:19:31 +00:00
|
|
|
if opts.ensure_installed and #opts.ensure_installed > 0 then
|
|
|
|
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
|
|
|
|
end
|
2023-02-17 16:38:28 +00:00
|
|
|
end, {})
|
2023-03-23 23:05:54 +00:00
|
|
|
|
|
|
|
vim.g.mason_binaries_list = opts.ensure_installed
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
2024-01-28 16:03:38 +00:00
|
|
|
event = "User FilePost",
|
2022-07-22 16:00:00 +00:00
|
|
|
config = function()
|
2023-09-28 01:52:02 +00:00
|
|
|
require("plugins.configs.lspconfig").defaults()
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- load luasnips + cmp related in insert mode only
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"hrsh7th/nvim-cmp",
|
2023-01-07 08:11:43 +00:00
|
|
|
event = "InsertEnter",
|
|
|
|
dependencies = {
|
|
|
|
{
|
|
|
|
-- snippet plugin
|
|
|
|
"L3MON4D3/LuaSnip",
|
|
|
|
dependencies = "rafamadriz/friendly-snippets",
|
2023-03-23 10:30:06 +00:00
|
|
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
|
|
|
config = function(_, opts)
|
2024-02-25 03:13:48 +00:00
|
|
|
require("luasnip").config.set_config(opts)
|
|
|
|
require "plugins.configs.luasnip"
|
2023-01-07 08:11:43 +00:00
|
|
|
end,
|
|
|
|
},
|
2022-07-22 16:00:00 +00:00
|
|
|
|
2023-01-07 08:11:43 +00:00
|
|
|
-- autopairing of (){}[] etc
|
|
|
|
{
|
|
|
|
"windwp/nvim-autopairs",
|
2023-02-17 16:38:28 +00:00
|
|
|
opts = {
|
|
|
|
fast_wrap = {},
|
|
|
|
disable_filetype = { "TelescopePrompt", "vim" },
|
|
|
|
},
|
|
|
|
config = function(_, opts)
|
|
|
|
require("nvim-autopairs").setup(opts)
|
|
|
|
|
|
|
|
-- setup cmp for autopairs
|
|
|
|
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
|
|
|
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
2023-01-07 08:11:43 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- cmp sources plugins
|
|
|
|
{
|
|
|
|
"saadparwaiz1/cmp_luasnip",
|
|
|
|
"hrsh7th/cmp-nvim-lua",
|
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
|
|
"hrsh7th/cmp-buffer",
|
|
|
|
"hrsh7th/cmp-path",
|
|
|
|
},
|
|
|
|
},
|
2023-02-17 16:38:28 +00:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.cmp"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
require("cmp").setup(opts)
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"numToStr/Comment.nvim",
|
2023-05-29 14:02:33 +00:00
|
|
|
keys = {
|
2023-06-24 01:19:07 +00:00
|
|
|
{ "gcc", mode = "n", desc = "Comment toggle current line" },
|
|
|
|
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
|
|
|
|
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
|
|
|
|
{ "gbc", mode = "n", desc = "Comment toggle current block" },
|
|
|
|
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
|
|
|
|
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
|
2023-05-29 14:02:33 +00:00
|
|
|
},
|
2023-04-01 07:17:42 +00:00
|
|
|
init = function()
|
2024-02-25 03:13:48 +00:00
|
|
|
vim.g.comment_maps = true
|
2023-04-01 07:17:42 +00:00
|
|
|
end,
|
2023-05-23 03:14:14 +00:00
|
|
|
config = function(_, opts)
|
|
|
|
require("Comment").setup(opts)
|
2022-08-04 14:32:16 +00:00
|
|
|
end,
|
2022-07-22 16:00:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
-- file managing , picker etc
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"nvim-tree/nvim-tree.lua",
|
2022-07-22 16:00:00 +00:00
|
|
|
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
2023-02-19 01:49:01 +00:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.nvimtree"
|
|
|
|
end,
|
2023-02-17 16:38:28 +00:00
|
|
|
config = function(_, opts)
|
2023-02-18 08:56:40 +00:00
|
|
|
dofile(vim.g.base46_cache .. "nvimtree")
|
2023-02-17 16:38:28 +00:00
|
|
|
require("nvim-tree").setup(opts)
|
2022-08-04 14:32:16 +00:00
|
|
|
end,
|
2022-07-22 16:00:00 +00:00
|
|
|
},
|
|
|
|
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"nvim-telescope/telescope.nvim",
|
2023-12-24 11:02:04 +00:00
|
|
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
2022-07-22 16:00:00 +00:00
|
|
|
cmd = "Telescope",
|
2023-02-17 16:38:28 +00:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.telescope"
|
2022-07-22 16:00:00 +00:00
|
|
|
end,
|
2023-02-17 16:38:28 +00:00
|
|
|
config = function(_, opts)
|
2023-02-18 08:56:40 +00:00
|
|
|
dofile(vim.g.base46_cache .. "telescope")
|
2023-02-17 16:38:28 +00:00
|
|
|
local telescope = require "telescope"
|
|
|
|
telescope.setup(opts)
|
|
|
|
|
|
|
|
-- load extensions
|
|
|
|
for _, ext in ipairs(opts.extensions_list) do
|
|
|
|
telescope.load_extension(ext)
|
|
|
|
end
|
2022-08-04 14:32:16 +00:00
|
|
|
end,
|
2022-07-22 16:00:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Only load whichkey after all the gui
|
2023-02-17 16:38:28 +00:00
|
|
|
{
|
|
|
|
"folke/which-key.nvim",
|
2023-10-16 14:36:34 +00:00
|
|
|
keys = { "<leader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
|
2023-08-27 05:58:56 +00:00
|
|
|
cmd = "WhichKey",
|
2023-02-17 16:38:28 +00:00
|
|
|
config = function(_, opts)
|
2023-02-18 08:56:40 +00:00
|
|
|
dofile(vim.g.base46_cache .. "whichkey")
|
2023-02-17 16:38:28 +00:00
|
|
|
require("which-key").setup(opts)
|
2022-08-04 14:32:16 +00:00
|
|
|
end,
|
2022-07-22 16:00:00 +00:00
|
|
|
},
|
2023-02-17 16:38:28 +00:00
|
|
|
}
|
2022-09-02 05:35:50 +00:00
|
|
|
|
2023-10-16 01:54:14 +00:00
|
|
|
local config = require "nvconfig"
|
2023-02-17 16:55:31 +00:00
|
|
|
|
|
|
|
if #config.plugins > 0 then
|
|
|
|
table.insert(default_plugins, { import = config.plugins })
|
|
|
|
end
|
|
|
|
|
2023-03-29 02:11:21 +00:00
|
|
|
require("lazy").setup(default_plugins, config.lazy_nvim)
|