plugins: More lazy load, yay
use vim.defer_fn to load the plugins after entering the ui add the lazy load to setup lazy load gitsigns, neoscroll, lspinstall and vim-matchup using this method rearrange according to startup sequence
This commit is contained in:
parent
66de975543
commit
adf0168dcc
2 changed files with 66 additions and 46 deletions
lua/core
|
@ -310,4 +310,14 @@ end]]
|
|||
return into
|
||||
end
|
||||
|
||||
-- load plugin after entering vim ui
|
||||
M.packer_lazy_load = function(plugin, timer)
|
||||
if plugin then
|
||||
timer = timer or 0
|
||||
vim.defer_fn(function()
|
||||
require("packer").loader(plugin)
|
||||
end, timer)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue