add : option to load autopairs sequentially (#584)

This commit is contained in:
siduck 2021-11-05 20:04:52 +05:30
parent 4b2bbe5d1c
commit c5fe1f711e
2 changed files with 24 additions and 23 deletions

View file

@ -75,6 +75,7 @@ M.plugins = {
autopairs = true, autopairs = true,
}, },
options = { options = {
autopairs = { loadAfter = "nvim-cmp" },
lspconfig = { lspconfig = {
setup_lspconf = "", -- path of file containing setups of different lsps setup_lspconf = "", -- path of file containing setups of different lsps
}, },

View file

@ -7,7 +7,7 @@ end
local use = packer.use local use = packer.use
return packer.startup(function() return packer.startup(function()
local status = require("core.utils").load_config().plugins.status local plugin_settings = require("core.utils").load_config().plugins
-- FUNCTION: override_req, use `chadrc` plugin config override if present -- FUNCTION: override_req, use `chadrc` plugin config override if present
-- name = name inside `default_config` / `chadrc` -- name = name inside `default_config` / `chadrc`
@ -64,14 +64,14 @@ return packer.startup(function()
use { use {
"famiu/feline.nvim", "famiu/feline.nvim",
disable = not status.feline, disable = not plugin_settings.status.feline,
after = "nvim-web-devicons", after = "nvim-web-devicons",
config = override_req("feline", "plugins.configs.statusline"), config = override_req("feline", "plugins.configs.statusline"),
} }
use { use {
"akinsho/bufferline.nvim", "akinsho/bufferline.nvim",
disable = not status.bufferline, disable = not plugin_settings.status.bufferline,
after = "nvim-web-devicons", after = "nvim-web-devicons",
config = override_req("bufferline", "plugins.configs.bufferline"), config = override_req("bufferline", "plugins.configs.bufferline"),
setup = function() setup = function()
@ -81,14 +81,14 @@ return packer.startup(function()
use { use {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
disable = not status.blankline, disable = not plugin_settings.status.blankline,
event = "BufRead", event = "BufRead",
config = override_req("indent_blankline", "(plugins.configs.others).blankline()"), config = override_req("indent_blankline", "(plugins.configs.others).blankline()"),
} }
use { use {
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",
disable = not status.colorizer, disable = not plugin_settings.status.colorizer,
event = "BufRead", event = "BufRead",
config = override_req("nvim_colorizer", "(plugins.configs.others).colorizer()"), config = override_req("nvim_colorizer", "(plugins.configs.others).colorizer()"),
} }
@ -103,7 +103,7 @@ return packer.startup(function()
-- git stuff -- git stuff
use { use {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
disable = not status.gitsigns, disable = not plugin_settings.status.gitsigns,
opt = true, opt = true,
config = override_req("gitsigns", "plugins.configs.gitsigns"), config = override_req("gitsigns", "plugins.configs.gitsigns"),
setup = function() setup = function()
@ -128,14 +128,14 @@ return packer.startup(function()
use { use {
"ray-x/lsp_signature.nvim", "ray-x/lsp_signature.nvim",
disable = not status.lspsignature, disable = not plugin_settings.status.lspsignature,
after = "nvim-lspconfig", after = "nvim-lspconfig",
config = override_req("signature", "(plugins.configs.others).signature()"), config = override_req("signature", "(plugins.configs.others).signature()"),
} }
use { use {
"andymass/vim-matchup", "andymass/vim-matchup",
disable = not status.vim_matchup, disable = not plugin_settings.status.vim_matchup,
opt = true, opt = true,
setup = function() setup = function()
require("core.utils").packer_lazy_load "vim-matchup" require("core.utils").packer_lazy_load "vim-matchup"
@ -144,7 +144,7 @@ return packer.startup(function()
use { use {
"max397574/better-escape.nvim", "max397574/better-escape.nvim",
disable = not status.esc_insertmode, disable = not plugin_settings.status.esc_insertmode,
event = "InsertEnter", event = "InsertEnter",
config = override_req("better_escape", "(plugins.configs.others).better_escape()"), config = override_req("better_escape", "(plugins.configs.others).better_escape()"),
} }
@ -153,20 +153,20 @@ return packer.startup(function()
use { use {
"rafamadriz/friendly-snippets", "rafamadriz/friendly-snippets",
disable = not status.cmp, disable = not plugin_settings.status.cmp,
event = "InsertEnter", event = "InsertEnter",
} }
use { use {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
disable = not status.cmp, disable = not plugin_settings.status.cmp,
after = "friendly-snippets", after = "friendly-snippets",
config = override_req("nvim_cmp", "plugins.configs.cmp"), config = override_req("nvim_cmp", "plugins.configs.cmp"),
} }
use { use {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
disable = not status.cmp, disable = not plugin_settings.status.cmp,
wants = "friendly-snippets", wants = "friendly-snippets",
after = "nvim-cmp", after = "nvim-cmp",
config = override_req("luasnip", "(plugins.configs.others).luasnip()"), config = override_req("luasnip", "(plugins.configs.others).luasnip()"),
@ -174,44 +174,44 @@ return packer.startup(function()
use { use {
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
disable = not status.cmp, disable = not plugin_settings.status.cmp,
after = "LuaSnip", after = "LuaSnip",
} }
use { use {
"hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-nvim-lua",
disable = not status.cmp, disable = not plugin_settings.status.cmp,
after = "cmp_luasnip", after = "cmp_luasnip",
} }
use { use {
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
disable = not status.cmp, disable = not plugin_settings.status.cmp,
after = "cmp-nvim-lua", after = "cmp-nvim-lua",
} }
use { use {
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
disable = not status.cmp, disable = not plugin_settings.status.cmp,
after = "cmp-nvim-lsp", after = "cmp-nvim-lsp",
} }
use { use {
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
disable = not status.cmp, disable = not plugin_settings.status.cmp,
after = "cmp-buffer", after = "cmp-buffer",
} }
-- misc plugins -- misc plugins
use { use {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
disable = not status.autopairs, disable = not plugin_settings.status.autopairs,
after = "nvim-cmp", after = plugin_settings.options.autopairs.loadAfter,
config = override_req("nvim_autopairs", "(plugins.configs.others).autopairs()"), config = override_req("nvim_autopairs", "(plugins.configs.others).autopairs()"),
} }
use { use {
"glepnir/dashboard-nvim", "glepnir/dashboard-nvim",
disable = not status.dashboard, disable = not plugin_settings.status.dashboard,
config = override_req("dashboard", "plugins.configs.dashboard"), config = override_req("dashboard", "plugins.configs.dashboard"),
setup = function() setup = function()
require("core.mappings").dashboard() require("core.mappings").dashboard()
@ -220,7 +220,7 @@ return packer.startup(function()
use { use {
"terrortylor/nvim-comment", "terrortylor/nvim-comment",
disable = not status.comment, disable = not plugin_settings.status.comment,
cmd = "CommentToggle", cmd = "CommentToggle",
config = override_req("nvim_comment", "(plugins.configs.others).comment()"), config = override_req("nvim_comment", "(plugins.configs.others).comment()"),
setup = function() setup = function()
@ -231,7 +231,7 @@ return packer.startup(function()
-- file managing , picker etc -- file managing , picker etc
use { use {
"kyazdani42/nvim-tree.lua", "kyazdani42/nvim-tree.lua",
disable = not status.nvimtree, disable = not plugin_settings.status.nvimtree,
cmd = { "NvimTreeToggle", "NvimTreeFocus" }, cmd = { "NvimTreeToggle", "NvimTreeFocus" },
config = override_req("nvim_tree", "plugins.configs.nvimtree"), config = override_req("nvim_tree", "plugins.configs.nvimtree"),
setup = function() setup = function()
@ -250,7 +250,7 @@ return packer.startup(function()
}, },
{ {
"nvim-telescope/telescope-media-files.nvim", "nvim-telescope/telescope-media-files.nvim",
disable = not status.telescope_media, disable = not plugin_settings.status.telescope_media,
setup = function() setup = function()
require("core.mappings").telescope_media() require("core.mappings").telescope_media()
end, end,