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.83k stars 266 forks source link

Make `refresh_configs` user-configurable #940

Open Janfel opened 2 years ago

Janfel commented 2 years ago

Describe the feature

There has been a feature introduced in #158 that automatically reloads modules providing a config or setup function. While this is very helpful, it is also quite limited in it’s flexibility, as it basically supports one particular use case and nothing more. On top of that, it iterates through and typechecks the entirety of package.loaded, even if the user is not using it.

To fix both these issues, I propose that refresh_configs() should call a user-defined callback, instead of the current hard-coded implementation. The current implementation should be provided as an option, with it staying the default for now to not break existing setups.