Zinit (formerly zplugin) is a flexible and fast Z Shell (zsh) plugin manager that will allow you to install any plugin from other zsh add-on frameworks (oh-my-zsh, Prezto, et al.) to standalone plugins from GitHub repositories and other sites. Widely recognized as the most performant of all the zsh frameworks, its secret sauce lies in asynchronous loading and bytecode compiling of not just all installed plugins but the plugin manager itself!
Ranked in these QuestionsQuestion Ranking
Pro Asynchronous Turbo Mode
This is Zplugin's unfair advantage when compared with all its competition. ATM postpones the loading of a plugin until after the processing of .zshrc is finished and your prompt is shown and ready for input, offering time savings well north of 80% compared to others' startup times. Essentially this means that you can now be typing that first command you want to execute DURING the extra 1-1.5 seconds that's needed to implement all the plugins in your setup instead of having to wait for it to be done before you can start typing.
Pro Supports Oh-My-Zsh & ZPrezto plugins
Oh-My-Zsh and ZPrezto represent two of the oldest and largest customization managers for Z Shell, each with standout modules that have earned them devoted followings. Zplugin lets you easily access any plugins from either with simple aliases that fetch and integrate them seamlessly within its matrix.
Pro Load / unload on condition allows to define multiple themes
Zplugin's turbo mode is not only active at startup, but also after it. It then can constantly (every second) check if e.g. a condition to load or unload a plugin has been meet. This allows to e.g. define a variable $THEME which will select the currently active theme – just set up a load condition THEME == 1 and unload condition THEME != 1 for the first theme plugin, then a second load condition THEME == 2 and unload condition THEME != 2 for the second theme plugin, etc.
Pro Clean startup time of less than 50 milliseconds
Some Z shell configuration frameworks use bytecode compiling to optimize the load times of the plugins you use, but Zplugin ITSELF is bytecode compiled on install. This provides the muscle to enable all the available commands and command variants for managing it without sacrificing any speed.
Pro Reports costs of each configured plugin
To make good decisions on which plugins are worth the time cost of use, you need good information. Zplugin gives you exactly that with the "zplugin time" command which outputs the exact number of milliseconds required to load each one on the current shell invocation. With that it's easy to know where to reclaim lost speed and invest time in more carefully selecting the features you implement from the troublemakers.
Pro Bytecode compiling for all plugins
Zplugin pre-compiles each plugin into bytecode, eliminating the need for the shell to parse and interpret them as written on each shell invocation as has been typically done.
Pro Completion management
With the Z Shell now (as of February 2019) closing in on its 30th birthday, there are multitudes of command completion modules to select from and customize. Zplugin provides a discrete and effective way to use as many as you see fit, as well as taking from each only the types of completions you actually need. This solves a major issue with custom shells, especially for sysadmins which may dabble in many different roles with their machine such as ssh remoting, development projects, container management, etc. Find the modules that give you shortcuts for all but only what you need from each.
Pro Install individual plugins from their Github repositories
Any experienced Z Shell ninja has a few plugins they've found which exist outside the usual management frameworks within their own individual repos. Zplugin provides a syntax that saves the work of cloning it manually and then sourcing the necessary commands into .zshrc. Just point it at the Git URL and let it work its magic.
Pro Binary Zsh module with autocompilation and statistics
Zplugin is equipped with a binary Zsh module, which:
- transparently autocompiles every file sourced by the source and dot (.) builtins,
- measures the loading time of every file sourced by the source and dot (.) builtins.
This is helpful when sourcing many files and/or loading complex plugins. It is good to know that the maximum performance that comes from the compilation of the scripts is guarded internally by Zsh. It is often the case that a (small) edit to a script makes the compiled version of the script outdated and we forget to run
Pro Ability to *unload* a plugin
Zplugin allows to unload any plugin. This is handy especially when switching themes – it then e.g. removes the precmd hooks that the unloaded theme did, making a clear ground for the new theme that's being loaded.
Pro Load a plugin on a change of a file
Zplugin has a feature where a loading of a plugin can be deferred until a file changes. This is done with the two interchangeable ice-mods
Pro Open Source
Con Lack of configuration examples for new users
While the documentation is both broad and deep, it assumes a disturbingly high level of familiarity with both the shell and the concepts behind synthesizing many separate plugins into a complete custom shell. I have strong doubts that any new convert to Z Shell could make good and quick use of it without first getting their feet wet with one of the older frameworks that offer the benefit of many pages of discussion between veterans on how exactly to make it do what you want.