2022-01-08 22:37:18 -05:00
|
|
|
local plugin_settings = require("core.utils").load_config().plugins
|
|
|
|
local present, packer = pcall(require, plugin_settings.options.packer.init_file)
|
2021-08-12 07:58:03 -04:00
|
|
|
|
2021-08-22 03:49:15 -04:00
|
|
|
if not present then
|
2021-08-16 03:49:09 -04:00
|
|
|
return false
|
2021-07-15 11:46:45 -04:00
|
|
|
end
|
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
local override_req = require("core.utils").override_req
|
2021-07-08 23:44:04 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
local plugins = {
|
|
|
|
{ "nvim-lua/plenary.nvim" },
|
|
|
|
{ "lewis6991/impatient.nvim" },
|
|
|
|
{ "nathom/filetype.nvim" },
|
2021-09-13 22:21:35 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-16 03:49:09 -04:00
|
|
|
"wbthomason/packer.nvim",
|
|
|
|
event = "VimEnter",
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-06-01 14:28:24 -04:00
|
|
|
|
2022-03-20 17:22:16 -04:00
|
|
|
{
|
|
|
|
"NvChad/extensions",
|
|
|
|
config = function ()
|
|
|
|
vim.schedule_wrap(require("nvchad.terminal").init())
|
|
|
|
end
|
|
|
|
},
|
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-22 03:49:15 -04:00
|
|
|
"NvChad/nvim-base16.lua",
|
|
|
|
after = "packer.nvim",
|
|
|
|
config = function()
|
|
|
|
require("colors").init()
|
|
|
|
end,
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-22 03:49:15 -04:00
|
|
|
"kyazdani42/nvim-web-devicons",
|
|
|
|
after = "nvim-base16.lua",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("nvim_web_devicons", "plugins.configs.icons", "setup"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-07-26 05:36:32 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-12-22 18:43:49 -05:00
|
|
|
"feline-nvim/feline.nvim",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.feline,
|
2021-08-17 02:42:33 -04:00
|
|
|
after = "nvim-web-devicons",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("feline", "plugins.configs.statusline", "setup"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-22 03:28:59 -04:00
|
|
|
"akinsho/bufferline.nvim",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.bufferline,
|
2021-08-26 05:40:26 -04:00
|
|
|
after = "nvim-web-devicons",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("bufferline", "plugins.configs.bufferline", "setup"),
|
2021-08-16 03:49:09 -04:00
|
|
|
setup = function()
|
2021-08-22 03:49:15 -04:00
|
|
|
require("core.mappings").bufferline()
|
2021-08-16 03:49:09 -04:00
|
|
|
end,
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-07-08 23:44:04 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-22 03:49:15 -04:00
|
|
|
"lukas-reineke/indent-blankline.nvim",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.blankline,
|
2021-08-22 03:49:15 -04:00
|
|
|
event = "BufRead",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("indent_blankline", "plugins.configs.others", "blankline"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-06-27 11:29:39 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2022-02-07 09:47:14 -05:00
|
|
|
"NvChad/nvim-colorizer.lua",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.colorizer,
|
2021-08-16 03:49:09 -04:00
|
|
|
event = "BufRead",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("nvim_colorizer", "plugins.configs.others", "colorizer"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-06-01 14:28:24 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-16 03:49:09 -04:00
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2022-03-01 02:13:34 -05:00
|
|
|
event = { "BufRead", "BufNewFile" },
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("nvim_treesitter", "plugins.configs.treesitter", "setup"),
|
2022-02-22 23:09:21 -05:00
|
|
|
run = ":TSUpdate",
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-06-25 12:06:13 -04:00
|
|
|
|
2021-08-26 05:40:26 -04:00
|
|
|
-- git stuff
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-26 05:40:26 -04:00
|
|
|
"lewis6991/gitsigns.nvim",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.gitsigns,
|
2021-08-26 05:40:26 -04:00
|
|
|
opt = true,
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("gitsigns", "plugins.configs.others", "gitsigns"),
|
2021-08-26 05:40:26 -04:00
|
|
|
setup = function()
|
|
|
|
require("core.utils").packer_lazy_load "gitsigns.nvim"
|
|
|
|
end,
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-26 05:40:26 -04:00
|
|
|
|
2021-08-26 22:26:44 -04:00
|
|
|
-- lsp stuff
|
2021-09-10 06:10:54 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-09-10 06:10:54 -04:00
|
|
|
"neovim/nvim-lspconfig",
|
2022-01-22 02:53:15 -05:00
|
|
|
module = "lspconfig",
|
2021-08-26 05:40:26 -04:00
|
|
|
opt = true,
|
|
|
|
setup = function()
|
2021-09-10 06:10:54 -04:00
|
|
|
require("core.utils").packer_lazy_load "nvim-lspconfig"
|
2021-10-01 10:04:18 -04:00
|
|
|
-- reload the current file so lsp actually starts for it
|
|
|
|
vim.defer_fn(function()
|
2021-10-02 01:29:23 -04:00
|
|
|
vim.cmd 'if &ft == "packer" | echo "" | else | silent! e %'
|
2021-10-01 10:04:18 -04:00
|
|
|
end, 0)
|
2021-08-26 05:40:26 -04:00
|
|
|
end,
|
2021-09-24 11:17:53 -04:00
|
|
|
config = override_req("lspconfig", "plugins.configs.lspconfig"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-22 03:49:15 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-22 03:49:15 -04:00
|
|
|
"ray-x/lsp_signature.nvim",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.lspsignature,
|
2021-08-22 03:49:15 -04:00
|
|
|
after = "nvim-lspconfig",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("signature", "plugins.configs.others", "signature"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-06-24 13:19:42 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-26 05:40:26 -04:00
|
|
|
"andymass/vim-matchup",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.vim_matchup,
|
2021-08-26 05:40:26 -04:00
|
|
|
opt = true,
|
|
|
|
setup = function()
|
|
|
|
require("core.utils").packer_lazy_load "vim-matchup"
|
|
|
|
end,
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-26 05:40:26 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-09-22 11:56:30 -04:00
|
|
|
"max397574/better-escape.nvim",
|
2021-12-16 02:32:49 -05:00
|
|
|
disable = not plugin_settings.status.better_escape,
|
2022-02-11 21:01:23 -05:00
|
|
|
event = "InsertCharPre",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("better_escape", "plugins.configs.others", "better_escape"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-07 01:55:23 -04:00
|
|
|
|
2021-08-26 21:14:58 -04:00
|
|
|
-- load luasnips + cmp related in insert mode only
|
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-09-06 21:37:39 -04:00
|
|
|
"rafamadriz/friendly-snippets",
|
2022-01-29 09:33:59 -05:00
|
|
|
module = "cmp_nvim_lsp",
|
2022-02-11 21:01:23 -05:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-03-01 02:13:34 -05:00
|
|
|
event = "InsertEnter",
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2022-01-29 09:33:59 -05:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-09-06 21:37:39 -04:00
|
|
|
"hrsh7th/nvim-cmp",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-02-11 21:01:23 -05:00
|
|
|
after = "friendly-snippets",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("nvim_cmp", "plugins.configs.cmp", "setup"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-26 21:14:58 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-26 22:41:46 -04:00
|
|
|
"L3MON4D3/LuaSnip",
|
2022-02-11 21:01:23 -05:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2021-08-26 22:41:46 -04:00
|
|
|
wants = "friendly-snippets",
|
2022-01-29 09:33:59 -05:00
|
|
|
after = "nvim-cmp",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("luasnip", "plugins.configs.others", "luasnip"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-26 21:14:58 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-26 21:14:58 -04:00
|
|
|
"saadparwaiz1/cmp_luasnip",
|
2022-02-11 21:01:23 -05:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-11 08:13:09 -05:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and "LuaSnip",
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-26 21:14:58 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-26 21:14:58 -04:00
|
|
|
"hrsh7th/cmp-nvim-lua",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-02-11 21:01:23 -05:00
|
|
|
after = "cmp_luasnip",
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-26 21:14:58 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-26 21:14:58 -04:00
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-29 09:33:59 -05:00
|
|
|
after = "cmp-nvim-lua",
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-26 21:14:58 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-26 21:14:58 -04:00
|
|
|
"hrsh7th/cmp-buffer",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-26 09:47:44 -05:00
|
|
|
after = "cmp-nvim-lsp",
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-08-26 21:14:58 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-09-29 08:46:43 -04:00
|
|
|
"hrsh7th/cmp-path",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-29 09:33:59 -05:00
|
|
|
after = "cmp-buffer",
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
|
|
|
|
2021-08-16 03:49:09 -04:00
|
|
|
-- misc plugins
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-16 03:49:09 -04:00
|
|
|
"windwp/nvim-autopairs",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.autopairs,
|
2022-01-26 09:47:44 -05:00
|
|
|
after = plugin_settings.options.autopairs.loadAfter,
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("nvim_autopairs", "plugins.configs.others", "autopairs"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-05-12 13:23:35 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2022-02-20 01:14:43 -05:00
|
|
|
disable = not plugin_settings.status.alpha,
|
|
|
|
"goolord/alpha-nvim",
|
2022-03-19 22:00:30 -04:00
|
|
|
config = override_req("alpha", "plugins.configs.alpha", "setup"),
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-06-25 22:10:23 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-12-11 11:53:09 -05:00
|
|
|
"numToStr/Comment.nvim",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.comment,
|
2021-12-11 11:53:09 -05:00
|
|
|
module = "Comment",
|
2022-02-07 09:47:14 -05:00
|
|
|
keys = { "gcc" },
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("nvim_comment", "plugins.configs.others", "comment"),
|
2021-08-22 03:49:15 -04:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").comment()
|
2021-08-16 03:49:09 -04:00
|
|
|
end,
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-06-24 13:21:39 -04:00
|
|
|
|
2021-08-22 03:49:15 -04:00
|
|
|
-- file managing , picker etc
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-22 03:49:15 -04:00
|
|
|
"kyazdani42/nvim-tree.lua",
|
2021-11-05 10:34:52 -04:00
|
|
|
disable = not plugin_settings.status.nvimtree,
|
2021-12-25 23:34:19 -05:00
|
|
|
-- only set "after" if lazy load is disabled and vice versa for "cmd"
|
|
|
|
after = not plugin_settings.options.nvimtree.lazy_load and "nvim-web-devicons",
|
2021-12-24 13:05:13 -05:00
|
|
|
cmd = plugin_settings.options.nvimtree.lazy_load and { "NvimTreeToggle", "NvimTreeFocus" },
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("nvim_tree", "plugins.configs.nvimtree", "setup"),
|
2021-08-22 03:49:15 -04:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").nvimtree()
|
2021-08-16 03:49:09 -04:00
|
|
|
end,
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
2021-06-25 22:22:48 -04:00
|
|
|
|
2022-01-30 02:21:46 -05:00
|
|
|
{
|
2021-08-22 03:45:25 -04:00
|
|
|
"nvim-telescope/telescope.nvim",
|
2022-01-20 01:07:32 -05:00
|
|
|
module = "telescope",
|
2021-08-22 03:45:25 -04:00
|
|
|
cmd = "Telescope",
|
2022-01-21 06:49:49 -05:00
|
|
|
config = override_req("telescope", "plugins.configs.telescope", "setup"),
|
2021-08-22 03:45:25 -04:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").telescope()
|
|
|
|
end,
|
2022-01-30 02:21:46 -05:00
|
|
|
},
|
|
|
|
}
|
2022-02-13 02:39:07 -05:00
|
|
|
|
|
|
|
--label plugins for operational assistance
|
|
|
|
plugins = require("core.utils").label_plugins(plugins)
|
2022-01-30 20:29:35 -05:00
|
|
|
--remove plugins specified in chadrc
|
2022-01-30 20:28:19 -05:00
|
|
|
plugins = require("core.utils").remove_default_plugins(plugins)
|
2022-02-13 02:39:07 -05:00
|
|
|
--add plugins specified in chadrc
|
|
|
|
plugins = require("core.utils").add_user_plugins(plugins)
|
2022-01-31 03:43:51 -05:00
|
|
|
|
2022-02-13 02:39:07 -05:00
|
|
|
return packer.startup(function(use)
|
2022-02-14 15:32:23 -05:00
|
|
|
for _, v in pairs(plugins) do
|
2022-02-13 02:39:07 -05:00
|
|
|
use(v)
|
2022-01-30 12:04:39 -05:00
|
|
|
end
|
2022-02-13 02:39:07 -05:00
|
|
|
end)
|