2023-01-07 09:11:43 +01:00
|
|
|
-- All plugins have lazy=true by default,to load a plugin on startup just lazy=false
|
2022-11-17 02:30:36 +01:00
|
|
|
-- List of all default plugins & their definitions
|
2023-02-17 17:38:28 +01:00
|
|
|
local default_plugins = {
|
2022-05-23 09:24:03 +02:00
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
"nvim-lua/plenary.nvim",
|
2022-09-02 07:35:50 +02:00
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
-- nvchad plugins
|
|
|
|
{ "NvChad/extensions", branch = "v2.0" },
|
2023-02-28 04:53:07 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
"NvChad/base46",
|
|
|
|
branch = "v2.0",
|
|
|
|
build = function()
|
|
|
|
require("base46").load_all_highlights()
|
|
|
|
end,
|
|
|
|
},
|
2022-07-22 18:00:00 +02:00
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"NvChad/ui",
|
2023-01-08 03:10:00 +01:00
|
|
|
branch = "v2.0",
|
2023-01-07 09:11:43 +01:00
|
|
|
lazy = false,
|
2022-07-22 18:00:00 +02:00
|
|
|
config = function()
|
2023-01-07 09:11:43 +01:00
|
|
|
require "nvchad_ui"
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"NvChad/nvterm",
|
2023-04-01 09:17:42 +02:00
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "nvterm"
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
2023-01-29 19:00:13 +01:00
|
|
|
require "base46.term"
|
2023-02-17 17:38:28 +01:00
|
|
|
require("nvterm").setup(opts)
|
2022-08-04 16:32:16 +02:00
|
|
|
end,
|
2022-07-22 18:00:00 +02:00
|
|
|
},
|
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"NvChad/nvim-colorizer.lua",
|
2023-04-01 09:17:42 +02:00
|
|
|
init = function()
|
|
|
|
require("core.utils").lazy_load "nvim-colorizer.lua"
|
|
|
|
end,
|
2023-02-19 02:49:01 +01:00
|
|
|
config = function(_, opts)
|
|
|
|
require("colorizer").setup(opts)
|
2023-02-17 17:38:28 +01:00
|
|
|
|
|
|
|
-- execute colorizer as soon as possible
|
|
|
|
vim.defer_fn(function()
|
|
|
|
require("colorizer").attach_to_buffer(0)
|
|
|
|
end, 0)
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"nvim-tree/nvim-web-devicons",
|
|
|
|
opts = function()
|
|
|
|
return { override = require("nvchad_ui.icons").devicons }
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "devicons")
|
|
|
|
require("nvim-web-devicons").setup(opts)
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"lukas-reineke/indent-blankline.nvim",
|
2023-01-07 09:11:43 +01:00
|
|
|
init = function()
|
2023-02-17 17:38:28 +01:00
|
|
|
require("core.utils").lazy_load "indent-blankline.nvim"
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
2023-02-19 02:49:01 +01:00
|
|
|
opts = function()
|
|
|
|
return require("plugins.configs.others").blankline
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
2023-02-26 05:47:45 +01:00
|
|
|
require("core.utils").load_mappings "blankline"
|
2023-02-17 17:38:28 +01:00
|
|
|
dofile(vim.g.base46_cache .. "blankline")
|
|
|
|
require("indent_blankline").setup(opts)
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2023-04-01 09:17:42 +02:00
|
|
|
init = function()
|
|
|
|
require("core.utils").lazy_load "nvim-treesitter"
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
|
2023-01-26 04:28:44 +01:00
|
|
|
build = ":TSUpdate",
|
2023-02-19 02:49:01 +01:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.treesitter"
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
2023-03-26 12:22:41 +02:00
|
|
|
dofile(vim.g.base46_cache .. "syntax")
|
2023-02-17 17:38:28 +01:00
|
|
|
require("nvim-treesitter.configs").setup(opts)
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- git stuff
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"lewis6991/gitsigns.nvim",
|
2023-05-03 10:19:50 +02:00
|
|
|
ft = { "gitcommit", "diff" },
|
2023-01-07 09:11:43 +01:00
|
|
|
init = function()
|
2022-11-17 02:30:36 +01:00
|
|
|
-- load gitsigns only when a git file is opened
|
|
|
|
vim.api.nvim_create_autocmd({ "BufRead" }, {
|
|
|
|
group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
|
|
|
|
callback = function()
|
2023-04-02 22:26:21 +02:00
|
|
|
vim.fn.system("git -C " .. '"' .. vim.fn.expand "%:p:h" .. '"' .. " rev-parse")
|
2022-11-17 02:30:36 +01:00
|
|
|
if vim.v.shell_error == 0 then
|
|
|
|
vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
|
|
|
|
vim.schedule(function()
|
2023-03-08 14:27:54 +01:00
|
|
|
require("lazy").load { plugins = { "gitsigns.nvim" } }
|
2022-11-17 02:30:36 +01:00
|
|
|
end)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
2023-02-19 02:49:01 +01:00
|
|
|
opts = function()
|
|
|
|
return require("plugins.configs.others").gitsigns
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "git")
|
|
|
|
require("gitsigns").setup(opts)
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- lsp stuff
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"williamboman/mason.nvim",
|
2022-11-17 02:30:36 +01:00
|
|
|
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
|
2023-02-19 02:49:01 +01:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.mason"
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
2023-02-18 09:56:40 +01:00
|
|
|
dofile(vim.g.base46_cache .. "mason")
|
2023-02-17 17:38:28 +01:00
|
|
|
require("mason").setup(opts)
|
2023-02-18 09:56:40 +01:00
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
-- custom nvchad cmd to install all mason binaries listed
|
|
|
|
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
|
|
|
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
|
|
|
|
end, {})
|
2023-03-24 00:05:54 +01:00
|
|
|
|
|
|
|
vim.g.mason_binaries_list = opts.ensure_installed
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
2023-04-01 09:17:42 +02:00
|
|
|
init = function()
|
|
|
|
require("core.utils").lazy_load "nvim-lspconfig"
|
|
|
|
end,
|
2022-07-22 18:00:00 +02:00
|
|
|
config = function()
|
|
|
|
require "plugins.configs.lspconfig"
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- load luasnips + cmp related in insert mode only
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"hrsh7th/nvim-cmp",
|
2023-01-07 09:11:43 +01:00
|
|
|
event = "InsertEnter",
|
|
|
|
dependencies = {
|
|
|
|
{
|
|
|
|
-- snippet plugin
|
|
|
|
"L3MON4D3/LuaSnip",
|
|
|
|
dependencies = "rafamadriz/friendly-snippets",
|
2023-03-23 11:30:06 +01:00
|
|
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
|
|
|
config = function(_, opts)
|
|
|
|
require("plugins.configs.others").luasnip(opts)
|
2023-01-07 09:11:43 +01:00
|
|
|
end,
|
|
|
|
},
|
2022-07-22 18:00:00 +02:00
|
|
|
|
2023-01-07 09:11:43 +01:00
|
|
|
-- autopairing of (){}[] etc
|
|
|
|
{
|
|
|
|
"windwp/nvim-autopairs",
|
2023-02-17 17:38:28 +01: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 09:11:43 +01: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 17:38:28 +01:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.cmp"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
require("cmp").setup(opts)
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"numToStr/Comment.nvim",
|
2023-05-29 16:02:33 +02:00
|
|
|
keys = {
|
|
|
|
{ "gcc", mode = "n" },
|
|
|
|
{ "gc", mode = "v" },
|
|
|
|
{ "gbc", mode = "n" },
|
|
|
|
{ "gb", mode = "v" },
|
|
|
|
},
|
2023-04-01 09:17:42 +02:00
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "comment"
|
|
|
|
end,
|
2023-05-23 05:14:14 +02:00
|
|
|
config = function(_, opts)
|
|
|
|
require("Comment").setup(opts)
|
2022-08-04 16:32:16 +02:00
|
|
|
end,
|
2022-07-22 18:00:00 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
-- file managing , picker etc
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"nvim-tree/nvim-tree.lua",
|
2022-07-22 18:00:00 +02:00
|
|
|
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
2023-04-01 09:17:42 +02:00
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "nvimtree"
|
|
|
|
end,
|
2023-02-19 02:49:01 +01:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.nvimtree"
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
2023-02-18 09:56:40 +01:00
|
|
|
dofile(vim.g.base46_cache .. "nvimtree")
|
2023-02-17 17:38:28 +01:00
|
|
|
require("nvim-tree").setup(opts)
|
2023-03-29 04:11:21 +02:00
|
|
|
vim.g.nvimtree_side = opts.view.side
|
2022-08-04 16:32:16 +02:00
|
|
|
end,
|
2022-07-22 18:00:00 +02:00
|
|
|
},
|
|
|
|
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"nvim-telescope/telescope.nvim",
|
2023-06-08 03:42:21 +02:00
|
|
|
dependencies = "nvim-treesitter/nvim-treesitter",
|
2022-07-22 18:00:00 +02:00
|
|
|
cmd = "Telescope",
|
2023-04-01 09:17:42 +02:00
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "telescope"
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.telescope"
|
2022-07-22 18:00:00 +02:00
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
2023-02-18 09:56:40 +01:00
|
|
|
dofile(vim.g.base46_cache .. "telescope")
|
2023-02-17 17:38:28 +01: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 16:32:16 +02:00
|
|
|
end,
|
2022-07-22 18:00:00 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
-- Only load whichkey after all the gui
|
2023-02-17 17:38:28 +01:00
|
|
|
{
|
|
|
|
"folke/which-key.nvim",
|
2023-04-12 14:33:18 +02:00
|
|
|
keys = { "<leader>", '"', "'", "`", "c", "v" },
|
2023-04-01 09:17:42 +02:00
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "whichkey"
|
|
|
|
end,
|
2023-02-17 17:38:28 +01:00
|
|
|
config = function(_, opts)
|
2023-02-18 09:56:40 +01:00
|
|
|
dofile(vim.g.base46_cache .. "whichkey")
|
2023-02-17 17:38:28 +01:00
|
|
|
require("which-key").setup(opts)
|
2022-08-04 16:32:16 +02:00
|
|
|
end,
|
2022-07-22 18:00:00 +02:00
|
|
|
},
|
2023-02-17 17:38:28 +01:00
|
|
|
}
|
2022-09-02 07:35:50 +02:00
|
|
|
|
2023-02-17 17:55:31 +01:00
|
|
|
local config = require("core.utils").load_config()
|
|
|
|
|
|
|
|
if #config.plugins > 0 then
|
|
|
|
table.insert(default_plugins, { import = config.plugins })
|
|
|
|
end
|
|
|
|
|
2023-03-29 04:11:21 +02:00
|
|
|
require("lazy").setup(default_plugins, config.lazy_nvim)
|