wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.89k stars 264 forks source link

Add time-deferred loaders #8

Open wbthomason opened 4 years ago

wbthomason commented 4 years ago

Mentioned in #4 - make it possible to specify a plugin to be loaded after some delay (not based on an autocommand).

lewis6991 commented 1 year ago

@wbthomason: Is this something we still want now? Sounds quite obscure to me.

comfortablynick commented 1 year ago

Is there any difference between this and using an autocmd and timer? I have this in my setup and it seems to work fine if I specify User PackLoad as the event for some plugins:

vim.defer_fn(function()
  api.nvim_exec_autocmds("User", { pattern = "PackLoad" })
end, 200)
max397574 commented 1 year ago

I think this is what has been requested with this issue. By the way you could just directly call require"packer".loader(<plugin>) inside the function() end instead of using the autocmd