rm un-needed lazyload function
This commit is contained in:
parent
936131c00a
commit
08453985ca
3 changed files with 61 additions and 88 deletions
|
|
@ -1,3 +1,4 @@
|
|||
-- List of all default plugins & their definitions
|
||||
local plugins = {
|
||||
|
||||
["nvim-lua/plenary.nvim"] = { module = "plenary" },
|
||||
|
|
@ -5,7 +6,19 @@ local plugins = {
|
|||
["lewis6991/impatient.nvim"] = {},
|
||||
|
||||
["wbthomason/packer.nvim"] = {
|
||||
cmd = require("core.lazy_load").packer_cmds,
|
||||
cmd = {
|
||||
"PackerSnapshot",
|
||||
"PackerSnapshotRollback",
|
||||
"PackerSnapshotDelete",
|
||||
"PackerInstall",
|
||||
"PackerUpdate",
|
||||
"PackerSync",
|
||||
"PackerClean",
|
||||
"PackerCompile",
|
||||
"PackerStatus",
|
||||
"PackerProfile",
|
||||
"PackerLoad",
|
||||
},
|
||||
config = function()
|
||||
require "plugins"
|
||||
end,
|
||||
|
|
@ -57,7 +70,7 @@ local plugins = {
|
|||
["lukas-reineke/indent-blankline.nvim"] = {
|
||||
opt = true,
|
||||
setup = function()
|
||||
require("core.lazy_load").on_file_open "indent-blankline.nvim"
|
||||
require("core.utils").lazy_load "indent-blankline.nvim"
|
||||
require("core.utils").load_mappings "blankline"
|
||||
end,
|
||||
config = function()
|
||||
|
|
@ -68,7 +81,7 @@ local plugins = {
|
|||
["NvChad/nvim-colorizer.lua"] = {
|
||||
opt = true,
|
||||
setup = function()
|
||||
require("core.lazy_load").on_file_open "nvim-colorizer.lua"
|
||||
require("core.utils").lazy_load "nvim-colorizer.lua"
|
||||
end,
|
||||
config = function()
|
||||
require("plugins.configs.others").colorizer()
|
||||
|
|
@ -78,9 +91,10 @@ local plugins = {
|
|||
["nvim-treesitter/nvim-treesitter"] = {
|
||||
module = "nvim-treesitter",
|
||||
setup = function()
|
||||
require("core.lazy_load").on_file_open "nvim-treesitter"
|
||||
require("core.utils").lazy_load "nvim-treesitter"
|
||||
end,
|
||||
cmd = require("core.lazy_load").treesitter_cmds,
|
||||
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSEnable", "TSDisable", "TSModuleInfo" },
|
||||
|
||||
run = ":TSUpdate",
|
||||
config = function()
|
||||
require "plugins.configs.treesitter"
|
||||
|
|
@ -91,7 +105,19 @@ local plugins = {
|
|||
["lewis6991/gitsigns.nvim"] = {
|
||||
ft = "gitcommit",
|
||||
setup = function()
|
||||
require("core.lazy_load").gitsigns()
|
||||
-- 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()
|
||||
vim.fn.system("git -C " .. vim.fn.expand "%:p:h" .. " rev-parse")
|
||||
if vim.v.shell_error == 0 then
|
||||
vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
|
||||
vim.schedule(function()
|
||||
require("packer").loader "gitsigns.nvim"
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
config = function()
|
||||
require("plugins.configs.others").gitsigns()
|
||||
|
|
@ -100,7 +126,7 @@ local plugins = {
|
|||
|
||||
-- lsp stuff
|
||||
["williamboman/mason.nvim"] = {
|
||||
cmd = require("core.lazy_load").mason_cmds,
|
||||
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
|
||||
config = function()
|
||||
require "plugins.configs.mason"
|
||||
end,
|
||||
|
|
@ -109,7 +135,7 @@ local plugins = {
|
|||
["neovim/nvim-lspconfig"] = {
|
||||
opt = true,
|
||||
setup = function()
|
||||
require("core.lazy_load").on_file_open "nvim-lspconfig"
|
||||
require("core.utils").lazy_load "nvim-lspconfig"
|
||||
end,
|
||||
config = function()
|
||||
require "plugins.configs.lspconfig"
|
||||
|
|
@ -198,7 +224,6 @@ local plugins = {
|
|||
},
|
||||
}
|
||||
|
||||
-- Load all plugins
|
||||
local present, packer = pcall(require, "packer")
|
||||
|
||||
if present then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue