2022-01-09 03:37:18 +00:00
|
|
|
local plugin_settings = require("core.utils").load_config().plugins
|
|
|
|
local present, packer = pcall(require, plugin_settings.options.packer.init_file)
|
2021-08-12 11:58:03 +00:00
|
|
|
|
2022-01-23 07:24:15 +00:00
|
|
|
-- if cmp isnt lazy loaded -> load lspconfig after it
|
|
|
|
local loadAfter_cmp = false
|
|
|
|
|
|
|
|
if not plugin_settings.options.cmp.lazy_load then
|
|
|
|
loadAfter_cmp = "cmp-nvim-lsp"
|
|
|
|
end
|
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
if not present then
|
2021-08-16 07:49:09 +00:00
|
|
|
return false
|
2021-07-15 15:46:45 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
local use = packer.use
|
2021-07-09 03:44:04 +00:00
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
return packer.startup(function()
|
2021-11-13 17:37:20 +00:00
|
|
|
local override_req = require("core.utils").override_req
|
2021-09-14 02:21:35 +00:00
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
-- this is arranged on the basis of when a plugin starts
|
|
|
|
|
|
|
|
-- this is the nvchad core repo containing utilities for some features like theme swticher, no need to lazy load
|
2021-11-13 17:37:20 +00:00
|
|
|
use "Nvchad/extensions"
|
|
|
|
use "nvim-lua/plenary.nvim"
|
2021-08-26 09:40:26 +00:00
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
|
|
|
"wbthomason/packer.nvim",
|
|
|
|
event = "VimEnter",
|
|
|
|
}
|
2021-06-01 18:28:24 +00:00
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
2021-08-22 07:49:15 +00:00
|
|
|
"NvChad/nvim-base16.lua",
|
|
|
|
after = "packer.nvim",
|
|
|
|
config = function()
|
|
|
|
require("colors").init()
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"kyazdani42/nvim-web-devicons",
|
|
|
|
after = "nvim-base16.lua",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("nvim_web_devicons", "plugins.configs.icons", "setup"),
|
2021-08-16 07:49:09 +00:00
|
|
|
}
|
2021-07-26 09:36:32 +00:00
|
|
|
|
2021-08-17 06:42:33 +00:00
|
|
|
use {
|
2021-12-22 23:43:49 +00:00
|
|
|
"feline-nvim/feline.nvim",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.feline,
|
2021-08-17 06:42:33 +00:00
|
|
|
after = "nvim-web-devicons",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("feline", "plugins.configs.statusline", "setup"),
|
2021-08-17 06:42:33 +00:00
|
|
|
}
|
2021-08-22 07:49:15 +00:00
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
2021-08-22 07:28:59 +00:00
|
|
|
"akinsho/bufferline.nvim",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.bufferline,
|
2021-08-26 09:40:26 +00:00
|
|
|
after = "nvim-web-devicons",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("bufferline", "plugins.configs.bufferline", "setup"),
|
2021-08-16 07:49:09 +00:00
|
|
|
setup = function()
|
2021-08-22 07:49:15 +00:00
|
|
|
require("core.mappings").bufferline()
|
2021-08-16 07:49:09 +00:00
|
|
|
end,
|
|
|
|
}
|
2021-07-09 03:44:04 +00:00
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
use {
|
|
|
|
"lukas-reineke/indent-blankline.nvim",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.blankline,
|
2021-08-22 07:49:15 +00:00
|
|
|
event = "BufRead",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("indent_blankline", "plugins.configs.others", "blankline"),
|
2021-08-16 07:49:09 +00:00
|
|
|
}
|
2021-06-27 15:29:39 +00:00
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
|
|
|
"norcalli/nvim-colorizer.lua",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.colorizer,
|
2021-08-16 07:49:09 +00:00
|
|
|
event = "BufRead",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("nvim_colorizer", "plugins.configs.others", "colorizer"),
|
2021-08-16 07:49:09 +00:00
|
|
|
}
|
2021-06-01 18:28:24 +00:00
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
|
|
|
event = "BufRead",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("nvim_treesitter", "plugins.configs.treesitter", "setup"),
|
2021-08-16 07:49:09 +00:00
|
|
|
}
|
2021-06-25 16:06:13 +00:00
|
|
|
|
2021-08-26 09:40:26 +00:00
|
|
|
-- git stuff
|
|
|
|
use {
|
|
|
|
"lewis6991/gitsigns.nvim",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.gitsigns,
|
2021-08-26 09:40:26 +00:00
|
|
|
opt = true,
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("gitsigns", "plugins.configs.others", "gitsigns"),
|
2021-08-26 09:40:26 +00:00
|
|
|
setup = function()
|
|
|
|
require("core.utils").packer_lazy_load "gitsigns.nvim"
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
2021-08-27 02:26:44 +00:00
|
|
|
-- lsp stuff
|
2021-09-10 10:10:54 +00:00
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
2021-09-10 10:10:54 +00:00
|
|
|
"neovim/nvim-lspconfig",
|
2022-01-22 07:53:15 +00:00
|
|
|
module = "lspconfig",
|
2021-08-26 09:40:26 +00:00
|
|
|
opt = true,
|
2022-01-23 07:24:15 +00:00
|
|
|
after = loadAfter_cmp,
|
2021-08-26 09:40:26 +00:00
|
|
|
setup = function()
|
2021-09-10 10:10:54 +00:00
|
|
|
require("core.utils").packer_lazy_load "nvim-lspconfig"
|
2021-10-01 14:04:18 +00:00
|
|
|
-- reload the current file so lsp actually starts for it
|
|
|
|
vim.defer_fn(function()
|
2021-10-02 05:29:23 +00:00
|
|
|
vim.cmd 'if &ft == "packer" | echo "" | else | silent! e %'
|
2021-10-01 14:04:18 +00:00
|
|
|
end, 0)
|
2021-08-26 09:40:26 +00:00
|
|
|
end,
|
2021-09-24 15:17:53 +00:00
|
|
|
config = override_req("lspconfig", "plugins.configs.lspconfig"),
|
2021-08-22 07:49:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"ray-x/lsp_signature.nvim",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.lspsignature,
|
2021-08-22 07:49:15 +00:00
|
|
|
after = "nvim-lspconfig",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("signature", "plugins.configs.others", "signature"),
|
2021-08-16 07:49:09 +00:00
|
|
|
}
|
2021-06-24 17:19:42 +00:00
|
|
|
|
2021-08-26 09:40:26 +00:00
|
|
|
use {
|
|
|
|
"andymass/vim-matchup",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.vim_matchup,
|
2021-08-26 09:40:26 +00:00
|
|
|
opt = true,
|
|
|
|
setup = function()
|
|
|
|
require("core.utils").packer_lazy_load "vim-matchup"
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
2021-09-22 15:56:30 +00:00
|
|
|
"max397574/better-escape.nvim",
|
2021-12-16 07:32:49 +00:00
|
|
|
disable = not plugin_settings.status.better_escape,
|
2021-08-22 07:49:15 +00:00
|
|
|
event = "InsertEnter",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("better_escape", "plugins.configs.others", "better_escape"),
|
2021-08-16 07:49:09 +00:00
|
|
|
}
|
2021-08-07 05:55:23 +00:00
|
|
|
|
2021-08-27 01:14:58 +00:00
|
|
|
-- load luasnips + cmp related in insert mode only
|
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
2021-09-07 01:37:39 +00:00
|
|
|
"rafamadriz/friendly-snippets",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2021-08-16 07:49:09 +00:00
|
|
|
event = "InsertEnter",
|
2021-09-07 01:37:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"hrsh7th/nvim-cmp",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-11 13:13:09 +00:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and "friendly-snippets",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("nvim_cmp", "plugins.configs.cmp", "setup"),
|
2021-08-27 01:14:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
2021-08-27 02:41:46 +00:00
|
|
|
"L3MON4D3/LuaSnip",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2021-08-27 02:41:46 +00:00
|
|
|
wants = "friendly-snippets",
|
2022-01-11 13:13:09 +00:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and "nvim-cmp",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("luasnip", "plugins.configs.others", "luasnip"),
|
2021-08-27 01:14:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"saadparwaiz1/cmp_luasnip",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-11 13:13:09 +00:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and "LuaSnip",
|
2021-08-27 01:14:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"hrsh7th/cmp-nvim-lua",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-11 13:13:09 +00:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and "cmp_luasnip",
|
2021-08-27 01:14:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-11 13:13:09 +00:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and "cmp-nvim-lua",
|
2021-08-27 01:14:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"hrsh7th/cmp-buffer",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-11 13:13:09 +00:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and "cmp-nvim-lsp",
|
2021-08-27 01:14:58 +00:00
|
|
|
}
|
|
|
|
|
2021-09-29 12:46:43 +00:00
|
|
|
use {
|
|
|
|
"hrsh7th/cmp-path",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.cmp,
|
2022-01-11 13:13:09 +00:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and "cmp-buffer",
|
2021-09-29 12:46:43 +00:00
|
|
|
}
|
2021-08-16 07:49:09 +00:00
|
|
|
-- misc plugins
|
|
|
|
use {
|
|
|
|
"windwp/nvim-autopairs",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.autopairs,
|
2022-01-11 13:13:09 +00:00
|
|
|
after = plugin_settings.options.cmp.lazy_load and plugin_settings.options.autopairs.loadAfter,
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("nvim_autopairs", "plugins.configs.others", "autopairs"),
|
2021-08-16 07:49:09 +00:00
|
|
|
}
|
2021-05-12 17:23:35 +00:00
|
|
|
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
|
|
|
"glepnir/dashboard-nvim",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.dashboard,
|
2021-09-14 02:21:35 +00:00
|
|
|
config = override_req("dashboard", "plugins.configs.dashboard"),
|
2021-08-16 07:49:09 +00:00
|
|
|
setup = function()
|
2021-08-22 07:49:15 +00:00
|
|
|
require("core.mappings").dashboard()
|
2021-08-16 07:49:09 +00:00
|
|
|
end,
|
|
|
|
}
|
2021-06-26 02:10:23 +00:00
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
use {
|
2021-12-11 16:53:09 +00:00
|
|
|
"numToStr/Comment.nvim",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.comment,
|
2021-12-11 16:53:09 +00:00
|
|
|
module = "Comment",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("nvim_comment", "plugins.configs.others", "comment"),
|
2021-08-22 07:49:15 +00:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").comment()
|
2021-08-16 07:49:09 +00:00
|
|
|
end,
|
|
|
|
}
|
2021-06-24 17:21:39 +00:00
|
|
|
|
2021-08-22 07:49:15 +00:00
|
|
|
-- file managing , picker etc
|
2021-08-16 07:49:09 +00:00
|
|
|
use {
|
2021-08-22 07:49:15 +00:00
|
|
|
"kyazdani42/nvim-tree.lua",
|
2021-11-05 14:34:52 +00:00
|
|
|
disable = not plugin_settings.status.nvimtree,
|
2021-12-26 04:34:19 +00: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 18:05:13 +00:00
|
|
|
cmd = plugin_settings.options.nvimtree.lazy_load and { "NvimTreeToggle", "NvimTreeFocus" },
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("nvim_tree", "plugins.configs.nvimtree", "setup"),
|
2021-08-22 07:49:15 +00:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").nvimtree()
|
2021-08-16 07:49:09 +00:00
|
|
|
end,
|
|
|
|
}
|
2021-06-26 02:22:48 +00:00
|
|
|
|
2021-08-22 07:45:25 +00:00
|
|
|
use {
|
|
|
|
"nvim-telescope/telescope.nvim",
|
2022-01-20 06:07:32 +00:00
|
|
|
module = "telescope",
|
2021-08-22 07:45:25 +00:00
|
|
|
cmd = "Telescope",
|
2022-01-21 11:49:49 +00:00
|
|
|
config = override_req("telescope", "plugins.configs.telescope", "setup"),
|
2021-08-22 07:45:25 +00:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").telescope()
|
|
|
|
end,
|
|
|
|
}
|
2021-11-15 17:21:51 +00:00
|
|
|
-- load user defined plugins
|
2022-01-07 14:28:05 +00:00
|
|
|
require("core.customPlugins").run(use)
|
2021-08-16 07:49:09 +00:00
|
|
|
end)
|