Try Live
Add Docs
Rankings
Pricing
Docs
Install
Theme
Install
Docs
Pricing
More...
More...
Try Live
Rankings
Enterprise
Create API Key
Add Docs
Zinit
https://github.com/zdharma-continuum/zinit
Admin
🌻 Flexible and fast ZSH plugin manager
Tokens:
21,161
Snippets:
249
Trust Score:
8
Update:
1 month ago
Context
Skills
Chat
Benchmark
87.1
Suggestions
Latest
Show doc for...
Code
Info
Show Results
Context Summary (auto-generated)
Raw
Copy
Link
# Zinit - Flexible Zsh Plugin Manager Zinit is a flexible and fast Zsh plugin manager that provides powerful features for managing Zsh plugins, snippets, and completions. Originally known as Zplugin, it has evolved into one of the most feature-rich plugin managers available for Zsh, supporting turbo mode for deferred loading, ice modifiers for fine-grained control, and a robust system for tracking and unloading plugins. The project is maintained by the zdharma-continuum organization and is at version 3.13.1. At its core, Zinit enables users to load plugins from GitHub repositories, source snippets from URLs or local files, manage completions, and optimize shell startup time through lazy loading. It tracks changes made by plugins (functions, aliases, bindkeys, zstyles, options, environment variables) enabling clean unloading, provides SVN support for downloading only specific directories from repositories, and offers comprehensive reporting tools for debugging plugin behavior. ## Core Loading APIs ### zinit load Loads a plugin with full tracking/reporting capabilities. ```zsh # Basic plugin load with tracking zinit load zdharma-continuum/history-search-multi-word # Load with user/plugin format zinit load zsh-users/zsh-autosuggestions # Load local plugin zinit load %/path/to/local/plugin ``` ### zinit light Light-loads a plugin without tracking (faster, recommended for most cases). ```zsh # Light load for better performance zinit light zsh-users/zsh-syntax-highlighting # Light load with bindkey tracking zinit light-mode for zdharma-continuum/fast-syntax-highlighting ``` ### zinit snippet Sources a snippet from a URL or local file. ```zsh # Load from URL zinit snippet https://github.com/ohmyzsh/ohmyzsh/raw/master/lib/git.zsh # Oh-My-Zsh shorthand zinit snippet OMZL::git.zsh zinit snippet OMZP::git # Prezto shorthand zinit snippet PZTM::helper ``` ## Ice Modifiers Ice modifiers configure how plugins/snippets are loaded. ### wait (Turbo Mode) Defers loading until shell is idle. ```zsh # Load after 0 seconds (next prompt) zinit ice wait zinit light zsh-users/zsh-autosuggestions # Load after 1 second zinit ice wait"1" zinit light zdharma-continuum/fast-syntax-highlighting # Load when specific condition is met zinit ice wait"[[ -n ${ZLAST_COMMANDS[(r)git*]} ]]" zinit light zdharma-continuum/zsh-diff-so-fancy ``` ### lucid Suppresses "Loaded" message during turbo loading. ```zsh zinit ice wait lucid zinit light zsh-users/zsh-completions ``` ### atload / atclone / atpull Execute code at specific lifecycle points. ```zsh # Run code after loading zinit ice atload"_zsh_autosuggest_start" zinit light zsh-users/zsh-autosuggestions # Run code after cloning zinit ice atclone"./configure" atpull"%atclone" make zinit light some-user/some-plugin # Run code after updating zinit ice atpull"zinit creinstall -q ." zinit light zsh-users/zsh-completions ``` ### pick Specify which file to source. ```zsh zinit ice pick"async.zsh" zinit light mafredri/zsh-async # Pick multiple files zinit ice pick"lib/*.zsh" zinit light ohmyzsh/ohmyzsh ``` ### src / multisrc Source additional files. ```zsh zinit ice src"init.zsh" zinit light zdharma-continuum/zinit-annex-bin-gem-node # Multiple sources zinit ice multisrc"lib/*.zsh" zinit light ohmyzsh/ohmyzsh ``` ### from (GitHub Releases) Download from GitHub releases instead of cloning. ```zsh # Download binary from releases zinit ice from"gh-r" as"program" zinit light junegunn/fzf # With bpick to select specific asset zinit ice from"gh-r" as"program" bpick"*linux*amd64*" zinit light sharkdp/fd ``` ### as (command/program/completion) Specify how to treat the plugin. ```zsh # Treat as command/program zinit ice as"program" pick"bin/git-dsf" zinit light zdharma-continuum/zsh-diff-so-fancy # Treat as completion zinit ice as"completion" zinit snippet https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker ``` ### make Run make after clone/update. ```zsh zinit ice make zinit light zdharma-continuum/zinit-module # With specific target zinit ice make"PREFIX=$ZPFX install" zinit light some-user/some-project ``` ### mv / cp Move or copy files after installation. ```zsh zinit ice mv"completions/_fzf -> _fzf" zinit light junegunn/fzf zinit ice cp"some-file -> new-location" zinit light some-user/some-plugin ``` ### id-as Rename plugin for zinit's tracking. ```zsh zinit ice id-as"my-prompt" zinit light some-user/some-prompt-theme ``` ### depth Limit git clone depth. ```zsh zinit ice depth"1" zinit light zsh-users/zsh-syntax-highlighting ``` ### ver Specify branch/tag/commit. ```zsh zinit ice ver"develop" zinit light some-user/some-plugin zinit ice ver"v1.2.3" zinit light some-user/some-plugin ``` ### blockf Block adding fpath entry (for manual control). ```zsh zinit ice blockf zinit light zsh-users/zsh-completions ``` ### compile Compile specific files. ```zsh zinit ice compile"lib/*.zsh" zinit light ohmyzsh/ohmyzsh ``` ### nocompile Skip compilation. ```zsh zinit ice nocompile zinit light some-user/some-plugin ``` ## For-Syntax (Recommended) Concise syntax for loading multiple plugins. ```zsh # Load multiple plugins with shared ices zinit wait lucid for \ atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \ zdharma-continuum/fast-syntax-highlighting \ blockf \ zsh-users/zsh-completions \ atload"!_zsh_autosuggest_start" \ zsh-users/zsh-autosuggestions # Light mode for better performance zinit light-mode for \ zdharma-continuum/zinit-annex-as-monitor \ zdharma-continuum/zinit-annex-bin-gem-node \ zdharma-continuum/zinit-annex-patch-dl \ zdharma-continuum/zinit-annex-rust ``` ## Management Commands ### zinit update Update plugins and snippets. ```zsh # Update specific plugin zinit update zsh-users/zsh-autosuggestions # Update all plugins zinit update --all # Update only snippets zinit update --snippets # Update only plugins zinit update --plugins # Parallel update zinit update --parallel # Update with reset (discard local changes) zinit update --reset some-user/some-plugin ``` ### zinit delete Delete plugins or snippets. ```zsh # Delete specific plugin zinit delete zsh-users/zsh-autosuggestions # Delete all unloaded plugins zinit delete --clean # Delete all plugins and snippets zinit delete --all ``` ### zinit self-update Update Zinit itself. ```zsh zinit self-update ``` ### zinit compile / uncompile Compile plugins for faster loading. ```zsh # Compile specific plugin zinit compile zsh-users/zsh-autosuggestions # Compile all plugins zinit compile --all # Uncompile plugin zinit uncompile zsh-users/zsh-autosuggestions # Uncompile all zinit uncompile --all ``` ### zinit cd Change directory to plugin's location. ```zsh zinit cd zsh-users/zsh-autosuggestions ``` ### zinit edit Edit plugin source with $EDITOR. ```zsh zinit edit zsh-users/zsh-autosuggestions ``` ### zinit unload Unload a plugin (works with tracked plugins). ```zsh zinit unload zsh-users/zsh-autosuggestions ``` ### zinit report Show plugin's report (tracked changes). ```zsh # Report for specific plugin zinit report zsh-users/zsh-autosuggestions # Report for all plugins zinit report --all ``` ### zinit list / loaded List loaded plugins. ```zsh zinit list zinit loaded # Filter by keyword zinit list syntax ``` ### zinit times Show loading times. ```zsh # Basic times zinit times # With milliseconds zinit times -m # Show load moments zinit times -a ``` ## Completion Management ### zinit creinstall Install completions from plugin. ```zsh zinit creinstall zsh-users/zsh-completions ``` ### zinit cuninstall Uninstall completions. ```zsh zinit cuninstall zsh-users/zsh-completions ``` ### zinit csearch Search for available completions. ```zsh zinit csearch ``` ### zinit completions Show installed completions. ```zsh zinit completions ``` ### zinit cdisable / cenable Disable or enable completions. ```zsh zinit cdisable _mkdir zinit cenable _mkdir ``` ### zinit compinit Refresh completions. ```zsh zinit compinit ``` ### zinit cdreplay Replay recorded compdef calls. ```zsh zinit cdreplay -q ``` ## Utility Functions ### zicompinit Wrapper for compinit with caching. ```zsh # In .zshrc after loading plugins zicompinit zicdreplay ``` ### zicdreplay Replay deferred compdef calls. ```zsh zicdreplay ``` ## Additional Commands ### zinit status Show git status for plugins. ```zsh # Status for specific plugin zinit status zsh-users/zsh-autosuggestions # Status for all zinit status --all ``` ### zinit changes Show git log for plugin. ```zsh zinit changes zsh-users/zsh-autosuggestions ``` ### zinit glance View plugin source with syntax highlighting. ```zsh zinit glance zsh-users/zsh-autosuggestions ``` ### zinit recall Reconstruct ice modifiers for plugin. ```zsh zinit recall zsh-users/zsh-autosuggestions ``` ### zinit recently Show recently changed plugins. ```zsh zinit recently "1 week" ``` ### zinit zstatus Show Zinit overall status. ```zsh zinit zstatus ``` ### zinit help Show help information. ```zsh zinit help ``` ### zinit version Show Zinit version. ```zsh zinit version ``` ## Installation ```bash # Using the installer script bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)" # Manual installation ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" mkdir -p "$(dirname $ZINIT_HOME)" git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" ``` ### Basic .zshrc Setup ```zsh # Initialize Zinit ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" source "${ZINIT_HOME}/zinit.zsh" # Load completions autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit # Load plugins with turbo mode zinit wait lucid for \ atinit"zicompinit; zicdreplay" \ zdharma-continuum/fast-syntax-highlighting \ atload"_zsh_autosuggest_start" \ zsh-users/zsh-autosuggestions \ blockf atpull'zinit creinstall -q .' \ zsh-users/zsh-completions ``` ## Summary Zinit excels as a plugin manager for users who want maximum control over their Zsh configuration with minimal performance impact. Its turbo mode enables sub-100ms shell startup times even with dozens of plugins by deferring their loading until after the first prompt. The ice modifier system provides granular control over every aspect of plugin installation and loading, from selecting specific files to compile, to executing custom code at various lifecycle points, to downloading binaries from GitHub releases. For integration, Zinit works seamlessly with existing Zsh frameworks like Oh-My-Zsh and Prezto through its snippet system and shorthand URLs (OMZP::, PZTM::). The for-syntax provides a clean, readable way to configure multiple plugins with shared settings. Advanced users can extend Zinit through annexes that add capabilities like automatic binary installation, Rust/Cargo integration, and more. Whether migrating from another plugin manager or starting fresh, Zinit's comprehensive feature set and active maintenance make it an excellent choice for managing a sophisticated Zsh configuration.