2021-08-22 09:49:15 +02:00
|
|
|
local present, packer = pcall(require, "plugins.packerInit")
|
2021-08-12 13:58:03 +02:00
|
|
|
|
2021-08-22 09:49:15 +02:00
|
|
|
if not present then
|
2021-08-16 09:49:09 +02:00
|
|
|
return false
|
2021-07-15 17:46:45 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
local use = packer.use
|
2021-07-09 05:44:04 +02:00
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
return packer.startup(function()
|
2021-09-30 06:21:00 +02:00
|
|
|
local status = require("core.utils").load_config().plugins.status
|
2021-09-14 04:21:35 +02:00
|
|
|
|
|
|
|
-- FUNCTION: override_req, use `chadrc` plugin config override if present
|
|
|
|
-- name = name inside `default_config` / `chadrc`
|
|
|
|
-- default_req = run this if 'name' does not exist in `default_config` / `chadrc`
|
|
|
|
-- if override or default_req start with `(`, then strip that and assume override calls a function, not a whole file
|
|
|
|
local override_req = function(name, default_req)
|
2021-09-24 11:30:20 +02:00
|
|
|
local override = require("core.utils").load_config().plugins.default_plugin_config_replace[name]
|
|
|
|
local result
|
|
|
|
|
|
|
|
if override == nil then
|
|
|
|
result = default_req
|
|
|
|
else
|
|
|
|
result = override
|
|
|
|
end
|
|
|
|
|
|
|
|
if string.match(result, "^%(") then
|
|
|
|
result = result:sub(2)
|
|
|
|
result = result:gsub("%)%.", "').", 1)
|
|
|
|
return "require('" .. result
|
|
|
|
else
|
|
|
|
return "require('" .. result .. "')"
|
|
|
|
end
|
2021-09-14 04:21:35 +02:00
|
|
|
end
|
|
|
|
|
2021-08-22 09:49:15 +02: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
|
|
|
|
use {
|
2021-08-22 14:17:14 +02:00
|
|
|
"Nvchad/extensions",
|
2021-08-22 09:49:15 +02:00
|
|
|
}
|
|
|
|
|
2021-08-26 11:40:26 +02:00
|
|
|
use {
|
|
|
|
"nvim-lua/plenary.nvim",
|
|
|
|
}
|
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
|
|
|
"wbthomason/packer.nvim",
|
|
|
|
event = "VimEnter",
|
|
|
|
}
|
2021-06-01 20:28:24 +02:00
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
2021-08-22 09:49:15 +02:00
|
|
|
"NvChad/nvim-base16.lua",
|
|
|
|
after = "packer.nvim",
|
|
|
|
config = function()
|
|
|
|
require("colors").init()
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"kyazdani42/nvim-web-devicons",
|
|
|
|
after = "nvim-base16.lua",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("nvim_web_devicons", "plugins.configs.icons"),
|
2021-08-16 09:49:09 +02:00
|
|
|
}
|
2021-07-26 11:36:32 +02:00
|
|
|
|
2021-08-17 08:42:33 +02:00
|
|
|
use {
|
2021-08-26 07:18:13 +02:00
|
|
|
"famiu/feline.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.feline,
|
2021-08-17 08:42:33 +02:00
|
|
|
after = "nvim-web-devicons",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("feline", "plugins.configs.statusline"),
|
2021-08-17 08:42:33 +02:00
|
|
|
}
|
2021-08-22 09:49:15 +02:00
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
2021-08-22 09:28:59 +02:00
|
|
|
"akinsho/bufferline.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.bufferline,
|
2021-08-26 11:40:26 +02:00
|
|
|
after = "nvim-web-devicons",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("bufferline", "plugins.configs.bufferline"),
|
2021-08-16 09:49:09 +02:00
|
|
|
setup = function()
|
2021-08-22 09:49:15 +02:00
|
|
|
require("core.mappings").bufferline()
|
2021-08-16 09:49:09 +02:00
|
|
|
end,
|
|
|
|
}
|
2021-07-09 05:44:04 +02:00
|
|
|
|
2021-08-22 09:49:15 +02:00
|
|
|
use {
|
|
|
|
"lukas-reineke/indent-blankline.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.blankline,
|
2021-08-22 09:49:15 +02:00
|
|
|
event = "BufRead",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("indent_blankline", "(plugins.configs.others).blankline()"),
|
2021-08-16 09:49:09 +02:00
|
|
|
}
|
2021-06-27 17:29:39 +02:00
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
|
|
|
"norcalli/nvim-colorizer.lua",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.colorizer,
|
2021-08-16 09:49:09 +02:00
|
|
|
event = "BufRead",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("nvim_colorizer", "(plugins.configs.others).colorizer()"),
|
2021-08-16 09:49:09 +02:00
|
|
|
}
|
2021-06-01 20:28:24 +02:00
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2021-09-09 03:20:15 +02:00
|
|
|
branch = "0.5-compat",
|
2021-08-16 09:49:09 +02:00
|
|
|
event = "BufRead",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("nvim_treesitter", "plugins.configs.treesitter"),
|
2021-08-16 09:49:09 +02:00
|
|
|
}
|
2021-06-25 18:06:13 +02:00
|
|
|
|
2021-08-26 11:40:26 +02:00
|
|
|
-- git stuff
|
|
|
|
use {
|
|
|
|
"lewis6991/gitsigns.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.gitsigns,
|
2021-08-26 11:40:26 +02:00
|
|
|
opt = true,
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("gitsigns", "plugins.configs.gitsigns"),
|
2021-08-26 11:40:26 +02:00
|
|
|
setup = function()
|
|
|
|
require("core.utils").packer_lazy_load "gitsigns.nvim"
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
|
|
|
-- smooth scroll
|
|
|
|
use {
|
|
|
|
"karb94/neoscroll.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.neoscroll,
|
2021-08-26 11:40:26 +02:00
|
|
|
opt = true,
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("neoscroll", "(plugins.configs.others).neoscroll()"),
|
2021-08-26 11:40:26 +02:00
|
|
|
setup = function()
|
|
|
|
require("core.utils").packer_lazy_load "neoscroll.nvim"
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
2021-08-27 04:26:44 +02:00
|
|
|
-- lsp stuff
|
2021-09-10 12:10:54 +02:00
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
2021-09-10 12:10:54 +02:00
|
|
|
"neovim/nvim-lspconfig",
|
2021-08-26 11:40:26 +02:00
|
|
|
opt = true,
|
|
|
|
setup = function()
|
2021-09-10 12:10:54 +02:00
|
|
|
require("core.utils").packer_lazy_load "nvim-lspconfig"
|
2021-08-26 20:14:12 +02:00
|
|
|
-- reload the current file so lsp actually starts for it
|
|
|
|
vim.defer_fn(function()
|
|
|
|
vim.cmd "silent! e %"
|
|
|
|
end, 0)
|
2021-08-26 11:40:26 +02:00
|
|
|
end,
|
2021-09-24 17:17:53 +02:00
|
|
|
config = override_req("lspconfig", "plugins.configs.lspconfig"),
|
2021-08-22 09:49:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"ray-x/lsp_signature.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.lspsignature,
|
2021-08-22 09:49:15 +02:00
|
|
|
after = "nvim-lspconfig",
|
2021-09-24 17:17:53 +02:00
|
|
|
config = override_req("signature", "(plugins.configs.others).signature()"),
|
2021-08-16 09:49:09 +02:00
|
|
|
}
|
2021-06-24 19:19:42 +02:00
|
|
|
|
2021-08-26 11:40:26 +02:00
|
|
|
use {
|
|
|
|
"andymass/vim-matchup",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.vim_matchup,
|
2021-08-26 11:40:26 +02:00
|
|
|
opt = true,
|
|
|
|
setup = function()
|
|
|
|
require("core.utils").packer_lazy_load "vim-matchup"
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
|
|
|
-- load autosave only if its globally enabled
|
|
|
|
use {
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.autosave,
|
2021-08-26 11:40:26 +02:00
|
|
|
"Pocco81/AutoSave.nvim",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("autosave", "(plugins.configs.others).autosave()"),
|
2021-08-26 11:40:26 +02:00
|
|
|
cond = function()
|
2021-09-19 10:11:28 +02:00
|
|
|
return require("core.utils").load_config().plugins.options.autosave == true
|
2021-08-26 11:40:26 +02:00
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
2021-09-22 17:56:30 +02:00
|
|
|
"max397574/better-escape.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.esc_insertmode,
|
2021-08-22 09:49:15 +02:00
|
|
|
event = "InsertEnter",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("better_escape", "(plugins.configs.others).better_escape()"),
|
2021-08-16 09:49:09 +02:00
|
|
|
}
|
2021-08-07 07:55:23 +02:00
|
|
|
|
2021-08-27 03:14:58 +02:00
|
|
|
-- load luasnips + cmp related in insert mode only
|
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
2021-09-07 03:37:39 +02:00
|
|
|
"rafamadriz/friendly-snippets",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-08-16 09:49:09 +02:00
|
|
|
event = "InsertEnter",
|
2021-09-07 03:37:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"hrsh7th/nvim-cmp",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-09-07 03:37:39 +02:00
|
|
|
after = "friendly-snippets",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("nvim_cmp", "plugins.configs.cmp"),
|
2021-08-27 03:14:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
2021-08-27 04:41:46 +02:00
|
|
|
"L3MON4D3/LuaSnip",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-08-27 04:41:46 +02:00
|
|
|
wants = "friendly-snippets",
|
|
|
|
after = "nvim-cmp",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("luasnip", "(plugins.configs.others).luasnip()"),
|
2021-08-27 03:14:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"saadparwaiz1/cmp_luasnip",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-08-27 04:41:46 +02:00
|
|
|
after = "LuaSnip",
|
2021-08-27 03:14:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"hrsh7th/cmp-nvim-lua",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-08-27 03:14:58 +02:00
|
|
|
after = "cmp_luasnip",
|
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-08-27 03:14:58 +02:00
|
|
|
after = "cmp-nvim-lua",
|
|
|
|
}
|
|
|
|
|
|
|
|
use {
|
|
|
|
"hrsh7th/cmp-buffer",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-08-27 03:14:58 +02:00
|
|
|
after = "cmp-nvim-lsp",
|
|
|
|
}
|
|
|
|
|
2021-09-29 14:46:43 +02:00
|
|
|
use {
|
|
|
|
"hrsh7th/cmp-path",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-09-29 14:46:43 +02:00
|
|
|
after = "cmp-buffer",
|
|
|
|
}
|
2021-08-16 09:49:09 +02:00
|
|
|
-- misc plugins
|
|
|
|
use {
|
|
|
|
"windwp/nvim-autopairs",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.cmp,
|
2021-08-27 03:14:58 +02:00
|
|
|
after = "nvim-cmp",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("nvim_autopairs", "(plugins.configs.others).autopairs()"),
|
2021-08-16 09:49:09 +02:00
|
|
|
}
|
2021-05-12 19:23:35 +02:00
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
|
|
|
"glepnir/dashboard-nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.dashboard,
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("dashboard", "plugins.configs.dashboard"),
|
2021-08-16 09:49:09 +02:00
|
|
|
setup = function()
|
2021-08-22 09:49:15 +02:00
|
|
|
require("core.mappings").dashboard()
|
2021-08-16 09:49:09 +02:00
|
|
|
end,
|
|
|
|
}
|
2021-06-26 04:10:23 +02:00
|
|
|
|
2021-08-22 09:49:15 +02:00
|
|
|
use {
|
|
|
|
"terrortylor/nvim-comment",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.comment,
|
2021-08-22 09:49:15 +02:00
|
|
|
cmd = "CommentToggle",
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("nvim_comment", "(plugins.configs.others).comment()"),
|
2021-08-22 09:49:15 +02:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").comment()
|
2021-08-16 09:49:09 +02:00
|
|
|
end,
|
|
|
|
}
|
2021-06-24 19:21:39 +02:00
|
|
|
|
2021-08-22 09:49:15 +02:00
|
|
|
-- file managing , picker etc
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
2021-08-22 09:49:15 +02:00
|
|
|
"kyazdani42/nvim-tree.lua",
|
2021-08-24 12:07:38 +02:00
|
|
|
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("nvim_tree", "plugins.configs.nvimtree"),
|
2021-08-22 09:49:15 +02:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").nvimtree()
|
2021-08-16 09:49:09 +02:00
|
|
|
end,
|
|
|
|
}
|
2021-06-26 04:22:48 +02:00
|
|
|
|
2021-08-22 09:45:25 +02:00
|
|
|
use {
|
|
|
|
"nvim-telescope/telescope.nvim",
|
2021-09-29 03:04:32 +02:00
|
|
|
module = "telescope",
|
2021-08-22 09:45:25 +02:00
|
|
|
cmd = "Telescope",
|
|
|
|
requires = {
|
|
|
|
{
|
|
|
|
"nvim-telescope/telescope-fzf-native.nvim",
|
|
|
|
run = "make",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"nvim-telescope/telescope-media-files.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.telescope_media,
|
2021-08-22 09:45:25 +02:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").telescope_media()
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("telescope", "plugins.configs.telescope"),
|
2021-08-22 09:45:25 +02:00
|
|
|
setup = function()
|
|
|
|
require("core.mappings").telescope()
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
2021-08-16 09:49:09 +02:00
|
|
|
use {
|
|
|
|
"Pocco81/TrueZen.nvim",
|
2021-09-30 06:21:00 +02:00
|
|
|
disable = not status.truezen,
|
2021-08-16 09:49:09 +02:00
|
|
|
cmd = {
|
|
|
|
"TZAtaraxis",
|
|
|
|
"TZMinimalist",
|
|
|
|
"TZFocus",
|
|
|
|
},
|
2021-09-14 04:21:35 +02:00
|
|
|
config = override_req("truezen", "plugins.configs.zenmode"),
|
2021-08-16 09:49:09 +02:00
|
|
|
setup = function()
|
2021-08-22 09:49:15 +02:00
|
|
|
require("core.mappings").truezen()
|
2021-08-16 09:49:09 +02:00
|
|
|
end,
|
|
|
|
}
|
2021-07-23 19:22:09 +02:00
|
|
|
|
2021-08-24 21:45:59 +02:00
|
|
|
require("core.hooks").run("install_plugins", use)
|
2021-08-16 09:49:09 +02:00
|
|
|
end)
|