mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2024-11-21 08:37:59 +01:00
c624ac0077
* feat: add option to disable aliases * docs: add docs for `ZINIT[NO_ALIASES]`
1754 lines
42 KiB
Groff
1754 lines
42 KiB
Groff
'\" t
|
|
.\" Automatically generated by Pandoc 2.14.1
|
|
.\"
|
|
.TH "" "" "" "" ""
|
|
.hy
|
|
.PP
|
|
[IMAGE: MIT License (https://img.shields.io/badge/license-MIT-blue.svg)]
|
|
[IMAGE: image (https://img.shields.io/github/tag/zdharma-continuum/zinit.svg)] (https://github.com/zdharma-continuum/zinit/releases)
|
|
[IMAGE: Join the chat at
|
|
https://gitter.im/zdharma-continuum/zinit (https://badges.gitter.im/zdharma-continuum/zinit.svg)] (https://gitter.im/zdharma-continuum/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
.RS
|
|
.PP
|
|
\f[B]Note\f[R]: The original author (https://github.com/psprint) of
|
|
zinit deleted the \f[C]zdharma\f[R] organization randomly.
|
|
.PP
|
|
This is a reliable fork / place for the continuation of the project.
|
|
.PP
|
|
\[u1F6A7] For migration instructions please refer to this wiki
|
|
entry (https://github.com/zdharma-continuum/zinit/wiki/%F0%9F%9A%9A-Migration-to-zdharma-continuum)
|
|
.RE
|
|
.PP
|
|
\f[B]Table of Contents\f[R] \f[I]generated with
|
|
DocToc (https://github.com/thlorenz/doctoc)\f[R]
|
|
.IP \[bu] 2
|
|
News
|
|
.IP \[bu] 2
|
|
Zinit
|
|
.IP \[bu] 2
|
|
Zinit Wiki
|
|
.IP \[bu] 2
|
|
Quick Start
|
|
.RS 2
|
|
.IP \[bu] 2
|
|
Install
|
|
.RS 2
|
|
.IP \[bu] 2
|
|
Automatic Installation (Recommended)
|
|
.IP \[bu] 2
|
|
Manual Installation
|
|
.RE
|
|
.IP \[bu] 2
|
|
Usage
|
|
.RS 2
|
|
.IP \[bu] 2
|
|
Introduction
|
|
.IP \[bu] 2
|
|
Plugins and snippets
|
|
.IP \[bu] 2
|
|
Upgrade Zinit and plugins
|
|
.IP \[bu] 2
|
|
Turbo and lucid
|
|
.IP \[bu] 2
|
|
Migration
|
|
.IP \[bu] 2
|
|
More Examples
|
|
.RE
|
|
.RE
|
|
.IP \[bu] 2
|
|
How to Use
|
|
.RS 2
|
|
.IP \[bu] 2
|
|
Ice Modifiers
|
|
.RS 2
|
|
.IP \[bu] 2
|
|
Cloning Options
|
|
.IP \[bu] 2
|
|
Selection of Files (To Source, \&...)
|
|
.IP \[bu] 2
|
|
Conditional Loading
|
|
.IP \[bu] 2
|
|
Plugin Output
|
|
.IP \[bu] 2
|
|
Completions
|
|
.IP \[bu] 2
|
|
Command Execution After Cloning, Updating or Loading
|
|
.IP \[bu] 2
|
|
Sticky-Emulation Of Other Shells
|
|
.IP \[bu] 2
|
|
Others
|
|
.IP \[bu] 2
|
|
Order of Execution
|
|
.RE
|
|
.IP \[bu] 2
|
|
Zinit Commands
|
|
.RS 2
|
|
.IP \[bu] 2
|
|
Help
|
|
.IP \[bu] 2
|
|
Loading and Unloading
|
|
.IP \[bu] 2
|
|
Completions
|
|
.IP \[bu] 2
|
|
Tracking of the Active Session
|
|
.IP \[bu] 2
|
|
Reports and Statistics
|
|
.IP \[bu] 2
|
|
Compiling
|
|
.IP \[bu] 2
|
|
Other
|
|
.RE
|
|
.IP \[bu] 2
|
|
Updating Zinit and Plugins
|
|
.RE
|
|
.IP \[bu] 2
|
|
Completions
|
|
.RS 2
|
|
.IP \[bu] 2
|
|
Calling \f[C]compinit\f[R] Without Turbo Mode
|
|
.IP \[bu] 2
|
|
Calling \f[C]compinit\f[R] With Turbo Mode
|
|
.IP \[bu] 2
|
|
Ignoring Compdefs
|
|
.IP \[bu] 2
|
|
Disabling System-Wide \f[C]compinit\f[R] Call (Ubuntu)
|
|
.RE
|
|
.IP \[bu] 2
|
|
Zinit Module
|
|
.IP \[bu] 2
|
|
Hints and Tips
|
|
.RS 2
|
|
.IP \[bu] 2
|
|
Customizing Paths
|
|
.IP \[bu] 2
|
|
Non-GitHub (Local) Plugins
|
|
.IP \[bu] 2
|
|
Extending Git
|
|
.RE
|
|
.IP \[bu] 2
|
|
Supporting
|
|
.IP \[bu] 2
|
|
Getting Help and Community
|
|
.SH News
|
|
.PP
|
|
See here
|
|
.PP
|
|
To see the full history check the changelog.
|
|
.SH Zinit
|
|
.PP
|
|
Zinit is a flexible and fast Zshell plugin manager that will allow you
|
|
to install everything from GitHub and other sites.
|
|
Its characteristics are:
|
|
.IP "1." 3
|
|
Zinit is currently the only plugin manager out there that provides Turbo
|
|
mode which yields \f[B]50-80% faster Zsh startup\f[R] (i.e.: the shell
|
|
will start up to \f[B]5\f[R] times faster!).
|
|
Check out a speed comparison with other popular plugin managers
|
|
here (https://github.com/zdharma-continuum/pm-perf-test).
|
|
.IP "2." 3
|
|
The plugin manager gives \f[B]reports\f[R] from plugin loadings
|
|
describing what \f[B]aliases\f[R], functions, \f[B]bindkeys\f[R], Zle
|
|
widgets, zstyles, \f[B]completions\f[R], variables, \f[C]PATH\f[R] and
|
|
\f[C]FPATH\f[R] elements a plugin has set up.
|
|
This allows to quickly familiarize oneself with a new plugin and
|
|
provides rich and easy to digest information which might be helpful on
|
|
various occasions.
|
|
.IP "3." 3
|
|
Supported is unloading of plugin and ability to list, (un)install and
|
|
\f[B]selectively disable\f[R], \f[B]enable\f[R] plugin\[cq]s
|
|
completions.
|
|
.IP "4." 3
|
|
The plugin manager supports loading Oh My Zsh and Prezto plugins and
|
|
libraries, however the implementation isn\[cq]t framework specific and
|
|
doesn\[cq]t bloat the plugin manager with such code (more on this topic
|
|
can be found on the Wiki, in the
|
|
Introduction (https://zdharma-continuum.github.io/zinit/wiki/INTRODUCTION/#oh_my_zsh_prezto)).
|
|
.IP "5." 3
|
|
The system does not use \f[C]$FPATH\f[R], loading multiple plugins
|
|
doesn\[cq]t clutter \f[C]$FPATH\f[R] with the same number of entries
|
|
(e.g.\ \f[C]10\f[R], \f[C]15\f[R] or more).
|
|
Code is immune to \f[C]KSH_ARRAYS\f[R] and other options typically
|
|
causing compatibility problems.
|
|
.IP "6." 3
|
|
Zinit supports special, dedicated \f[B]packages\f[R] that offload the
|
|
user from providing long and complex commands.
|
|
See the zinit-packages
|
|
repository (https://github.com/zdharma-continuum/zinit-packages) for a
|
|
growing, complete list of Zinit packages and the Wiki
|
|
page (https://zdharma-continuum.github.io/zinit/wiki/Zinit-Packages/)
|
|
for an article about the feature.
|
|
.IP "7." 3
|
|
Also, specialized Zinit extensions \[em] called \f[B]annexes\f[R] \[em]
|
|
allow to extend the plugin manager with new commands, URL-preprocessors
|
|
(used by e.g.:
|
|
zinit-annex-as-monitor (https://github.com/zdharma-continuum/zinit-annex-as-monitor)
|
|
annex), post-install and post-update hooks and much more.
|
|
See the zdharma-continuum (https://github.com/zdharma-continuum)
|
|
organization for a growing, complete list of available Zinit extensions
|
|
and refer to the Wiki
|
|
article (https://zdharma-continuum.github.io/zinit/wiki/Annexes/) for an
|
|
introduction on creating your own annex.
|
|
.SH Zinit Wiki
|
|
.PP
|
|
The information in this README is complemented by the Zinit
|
|
Wiki (https://zdharma-continuum.github.io/zinit/wiki/).
|
|
The README is an introductory overview of Zinit while the Wiki gives a
|
|
complete information with examples.
|
|
Make sure to read it to get the most out of Zinit.
|
|
.SH Quick Start
|
|
.SS Install
|
|
.SS Automatic Installation (Recommended)
|
|
.PP
|
|
The easiest way to install Zinit is to execute:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
sh -c \[dq]$(curl -fsSL https://git.io/zinit-install)\[dq]
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
This will install Zinit in \f[C]\[ti]/.local/share/zinit/zinit.git\f[R].
|
|
\f[C].zshrc\f[R] will be updated with three lines of code that will be
|
|
added to the bottom.
|
|
The lines will be sourcing \f[C]zinit.zsh\f[R] and setting up completion
|
|
for command \f[C]zinit\f[R].
|
|
.PP
|
|
After installing and reloading the shell compile Zinit with
|
|
\f[C]zinit self-update\f[R].
|
|
.SS Manual Installation
|
|
.PP
|
|
To manually install Zinit clone the repo to
|
|
e.g.\ \f[C]\[ti]/.local/share/zinit/zinit.git\f[R]:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
ZINIT_HOME=\[dq]${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git\[dq]
|
|
mkdir -p \[dq]$(dirname $ZINIT_HOME)\[dq]
|
|
git clone https://github.com/zdharma-continuum/zinit.git \[dq]$ZINIT_HOME\[dq]
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
and source \f[C]zinit.zsh\f[R] from your \f[C].zshrc\f[R] (above
|
|
compinit (http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization)):
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
ZINIT_HOME=\[dq]${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git\[dq]
|
|
source \[dq]${ZINIT_HOME}/zinit.zsh\[dq]
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
If you place the \f[C]source\f[R] below \f[C]compinit\f[R], then add
|
|
those two lines after the \f[C]source\f[R]:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
autoload -Uz _zinit
|
|
(( ${+_comps} )) && _comps[zinit]=_zinit
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
Various paths can be customized, see section Customizing Paths.
|
|
.PP
|
|
After installing and reloading the shell compile Zinit with
|
|
\f[C]zinit self-update\f[R].
|
|
.SS Usage
|
|
.SS Introduction
|
|
.PP
|
|
Click here to read the introduction to
|
|
Zinit (https://zdharma-continuum.github.io/zinit/wiki/INTRODUCTION/).
|
|
It explains basic usage and some of the more unique features of Zinit
|
|
such as the Turbo mode.
|
|
If you\[cq]re new to Zinit we highly recommend you read it at least
|
|
once.
|
|
.SS Plugins and snippets
|
|
.PP
|
|
Plugins can be loaded using \f[C]load\f[R] or \f[C]light\f[R].
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit load <repo/plugin> # Load with reporting/investigating.
|
|
zinit light <repo/plugin> # Load without reporting/investigating.
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
If you want to source local or remote files (using direct URL), you can
|
|
do so with \f[C]snippet\f[R].
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit snippet <URL>
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
Such lines should be added to \f[C].zshrc\f[R].
|
|
Snippets are cached locally, use \f[C]-f\f[R] option to download a fresh
|
|
version of a snippet, or \f[C]zinit update {URL}\f[R].
|
|
Can also use \f[C]zinit update --all\f[R] to update all snippets (and
|
|
plugins).
|
|
.PP
|
|
\f[B]Example\f[R]
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# Plugin history-search-multi-word loaded with investigating.
|
|
zinit load zdharma-continuum/history-search-multi-word
|
|
|
|
# Two regular plugins loaded without investigating.
|
|
zinit light zsh-users/zsh-autosuggestions
|
|
zinit light zdharma-continuum/fast-syntax-highlighting
|
|
|
|
# Snippet
|
|
zinit snippet https://gist.githubusercontent.com/hightemp/5071909/raw/
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]Prompt(Theme) Example\f[R]
|
|
.PP
|
|
This is powerlevel10k (https://github.com/romkatv/powerlevel10k),
|
|
pure (https://github.com/sindresorhus/pure),
|
|
starship (https://github.com/starship/starship) sample:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# Load powerlevel10k theme
|
|
zinit ice depth\[dq]1\[dq] # git clone depth
|
|
zinit light romkatv/powerlevel10k
|
|
|
|
# Load pure theme
|
|
zinit ice pick\[dq]async.zsh\[dq] src\[dq]pure.zsh\[dq] # with zsh-async library that\[aq]s bundled with it.
|
|
zinit light sindresorhus/pure
|
|
|
|
# Load starship theme
|
|
zinit ice as\[dq]command\[dq] from\[dq]gh-r\[dq] \[rs] # \[ga]starship\[ga] binary as command, from github release
|
|
atclone\[dq]./starship init zsh > init.zsh; ./starship completions zsh > _starship\[dq] \[rs] # starship setup at clone(create init.zsh, completion)
|
|
atpull\[dq]%atclone\[dq] src\[dq]init.zsh\[dq] # pull behavior same as clone, source init.zsh
|
|
zinit light starship/starship
|
|
\f[R]
|
|
.fi
|
|
.SS Upgrade Zinit and plugins
|
|
.PP
|
|
Zinit can be updated to \f[C]self-update\f[R] and plugins to
|
|
\f[C]update\f[R].
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# Self update
|
|
zinit self-update
|
|
|
|
# Plugin update
|
|
zinit update
|
|
|
|
# Plugin parallel update
|
|
zinit update --parallel
|
|
|
|
# Increase the number of jobs in a concurrent-set to 40
|
|
zinit update --parallel 40
|
|
\f[R]
|
|
.fi
|
|
.SS Turbo and lucid
|
|
.PP
|
|
Turbo and lucid are the most used options.
|
|
Turbo Mode
|
|
.PP
|
|
Turbo mode is the key to performance.
|
|
It can be loaded asynchronously, which makes a huge difference when the
|
|
amount of plugins increases.
|
|
.PP
|
|
Usually used as \f[C]zinit ice wait\[dq]<SECONDS>\[dq]\f[R], let\[cq]s
|
|
use the previous example:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit ice wait # wait is same wait\[dq]0\[dq]
|
|
zinit load zdharma-continuum/history-search-multi-word
|
|
|
|
zinit ice wait\[dq]2\[dq] # load after 2 seconds
|
|
zinit load zdharma-continuum/history-search-multi-word
|
|
|
|
zinit ice wait # also be used in \[ga]light\[ga] and \[ga]snippet\[ga]
|
|
zinit snippet https://gist.githubusercontent.com/hightemp/5071909/raw/
|
|
\f[R]
|
|
.fi
|
|
Lucid
|
|
.PP
|
|
Turbo mode is verbose, so you need an option for quiet.
|
|
.PP
|
|
You can use with \f[C]lucid\f[R]:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit ice wait lucid
|
|
zinit load zdharma-continuum/history-search-multi-word
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]\f[BI]F&A:\f[B]\f[R] What is \f[C]ice\f[R]?
|
|
.PP
|
|
\f[C]ice\f[R] is zinit\[cq]s option command.
|
|
The option melts like ice and is used only once.
|
|
(more: Ice Modifiers)
|
|
.SS Migration
|
|
Migration from Oh-My-ZSH
|
|
.PP
|
|
\f[B]Basic\f[R]
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit snippet <URL> # Raw Syntax with URL
|
|
zinit snippet OMZ::<PATH> # Shorthand OMZ/ (https://github.com/ohmyzsh/ohmyzsh/raw/master/)
|
|
zinit snippet OMZL::<PATH> # Shorthand OMZ/lib/
|
|
zinit snippet OMZT::<PATH> # Shorthand OMZ/themes/
|
|
zinit snippet OMZP::<PATH> # Shorthand OMZ/plugins/
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]Library\f[R]
|
|
.PP
|
|
Importing the
|
|
clipboard (https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/clipboard.zsh)
|
|
and
|
|
termsupport (https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh)
|
|
Oh-My-Zsh Library Sample:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# Raw Syntax
|
|
zinit snippet https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/clipboard.zsh
|
|
zinit snippet https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/termsupport.zsh
|
|
|
|
# OMZ Shorthand Syntax
|
|
zinit snippet OMZ::lib/clipboard.zsh
|
|
zinit snippet OMZ::lib/termsupport.zsh
|
|
|
|
# OMZL Shorthand Syntax
|
|
zinit snippet OMZL::clipboard.zsh
|
|
zinit snippet OMZL::termsupport.zsh
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]Theme\f[R]
|
|
.PP
|
|
To use \f[B]themes\f[R] created for Oh My Zsh you might want to first
|
|
source the \f[C]git\f[R] library there.
|
|
.PP
|
|
Then you can use the themes as snippets
|
|
(\f[C]zinit snippet <file path or GitHub URL>\f[R]).
|
|
Some themes require not only Oh My Zsh\[cq]s Git \f[B]library\f[R], but
|
|
also Git \f[B]plugin\f[R] (error about \f[C]current_branch\f[R] may
|
|
appear).
|
|
Load this Git-plugin as single-file snippet directly from OMZ.
|
|
.PP
|
|
Most themes require \f[C]promptsubst\f[R] option
|
|
(\f[C]setopt promptsubst\f[R] in \f[C]zshrc\f[R]), if it isn\[cq]t set,
|
|
then prompt will appear as something like:
|
|
\f[C]... $(build_prompt) ...\f[R].
|
|
.PP
|
|
You might want to suppress completions provided by the git plugin by
|
|
issuing \f[C]zinit cdclear -q\f[R] (\f[C]-q\f[R] is for quiet)
|
|
\[en]\ see below \f[B]Ignoring Compdefs\f[R].
|
|
.PP
|
|
To summarize:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
## Oh My Zsh Setting
|
|
ZSH_THEME=\[dq]robbyrussell\[dq]
|
|
|
|
## Zinit Setting
|
|
# Must Load OMZ Git library
|
|
zinit snippet OMZL::git.zsh
|
|
|
|
# Load Git plugin from OMZ
|
|
zinit snippet OMZP::git
|
|
zinit cdclear -q # <- forget completions provided up to this moment
|
|
|
|
setopt promptsubst
|
|
|
|
# Load Prompt
|
|
zinit snippet OMZT::robbyrussell
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
External Theme Sample:
|
|
NicoSantangelo/Alpharized (https://github.com/nicosantangelo/Alpharized)
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
## Oh My Zsh Setting
|
|
ZSH_THEME=\[dq]alpharized\[dq]
|
|
|
|
## Zinit Setting
|
|
# Must Load OMZ Git library
|
|
zinit snippet OMZL::git.zsh
|
|
|
|
# Load Git plugin from OMZ
|
|
zinit snippet OMZP::git
|
|
zinit cdclear -q # <- forget completions provided up to this moment
|
|
|
|
setopt promptsubst
|
|
|
|
# Load Prompt
|
|
zinit light NicoSantangelo/Alpharized
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]\f[BI]F&A:\f[B]\f[R] Error occurs when loading OMZ\[cq]s theme.
|
|
.PP
|
|
If the \f[C]git\f[R] library will not be loaded, then similar to
|
|
following errors will be appearing:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
\&........:1: command not found: git_prompt_status
|
|
\&........:1: command not found: git_prompt_short_sha
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]Plugin\f[R]
|
|
.PP
|
|
If it consists of a single file, you can just load it.
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
## Oh-My-Zsh Setting
|
|
plugins=(
|
|
git
|
|
dotenv
|
|
rake
|
|
rbenv
|
|
ruby
|
|
)
|
|
|
|
## Zinit Setting
|
|
zinit snippet OMZP::git
|
|
zinit snippet OMZP::dotenv
|
|
zinit snippet OMZP::rake
|
|
zinit snippet OMZP::rbenv
|
|
zinit snippet OMZP::ruby
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
Use \f[C]zinit ice svn\f[R] if multiple files require an entire
|
|
subdirectory.
|
|
Like
|
|
gitfast (https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gitfast),
|
|
osx (https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/osx):
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit ice svn
|
|
zinit snippet OMZP::gitfast
|
|
|
|
zinit ice svn
|
|
zinit snippet OMZP::osx
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
Use \f[C]zinit ice as\[dq]completion\[dq]\f[R] to directly add single
|
|
file completion snippets.
|
|
Like
|
|
docker (https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/docker),
|
|
fd (https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/fd):
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit ice as\[dq]completion\[dq]
|
|
zinit snippet OMZP::docker/_docker
|
|
|
|
zinit ice as\[dq]completion\[dq]
|
|
zinit snippet OMZP::fd/_fd
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
You can see an extended explanation of Oh-My-Zsh setup in the
|
|
Wiki (https://zdharma-continuum.github.io/zinit/wiki/Example-Oh-My-Zsh-setup/)
|
|
Migration from Prezto
|
|
.PP
|
|
\f[B]Basic\f[R]
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit snippet <URL> # Raw Syntax with URL
|
|
zinit snippet PZT::<PATH> # Shorthand PZT/ (https://github.com/sorin-ionescu/prezto/tree/master/)
|
|
zinit snippet PZTM::<PATH> # Shorthand PZT/modules/
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]Modules\f[R]
|
|
.PP
|
|
Importing the
|
|
environment (https://github.com/sorin-ionescu/prezto/tree/master/modules/environment)
|
|
and
|
|
terminal (https://github.com/sorin-ionescu/prezto/tree/master/modules/terminal)
|
|
Prezto Modules Sample:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
## Prezto Setting
|
|
zstyle \[aq]:prezto:load\[aq] pmodule \[aq]environment\[aq] \[aq]terminal\[aq]
|
|
|
|
## Zinit Setting
|
|
# Raw Syntax
|
|
zinit snippet https://github.com/sorin-ionescu/prezto/blob/master/modules/environment/init.zsh
|
|
zinit snippet https://github.com/sorin-ionescu/prezto/blob/master/modules/terminal/init.zsh
|
|
|
|
# PZT Shorthand Syntax
|
|
zinit snippet PZT::modules/environment
|
|
zinit snippet PZT::modules/terminal
|
|
|
|
# PZTM Shorthand Syntax
|
|
zinit snippet PZTM::environment
|
|
zinit snippet PZTM::terminal
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
Use \f[C]zinit ice svn\f[R] if multiple files require an entire
|
|
subdirectory.
|
|
Like
|
|
docker (https://github.com/sorin-ionescu/prezto/tree/master/modules/docker),
|
|
git (https://github.com/sorin-ionescu/prezto/tree/master/modules/git):
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit ice svn
|
|
zinit snippet PZTM::docker
|
|
|
|
zinit ice svn
|
|
zinit snippet PZTM::git
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
Use \f[C]zinit ice as\[dq]null\[dq]\f[R] if don\[cq]t exist
|
|
\f[C]*.plugin.zsh\f[R], \f[C]init.zsh\f[R], \f[C]*.zsh-theme*\f[R] files
|
|
in module.
|
|
Like
|
|
archive (https://github.com/sorin-ionescu/prezto/tree/master/modules/archive):
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit ice svn as\[dq]null\[dq]
|
|
zinit snippet PZTM::archive
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
Use \f[C]zinit ice atclone\[dq]git clone <repo> <location>\[dq]\f[R] if
|
|
module have external module.
|
|
Like
|
|
completion (https://github.com/sorin-ionescu/prezto/tree/master/modules/completion):
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zplugin ice svn blockf \[rs] # use blockf to prevent any unnecessary additions to fpath, as zinit manages fpath
|
|
atclone\[dq]git clone --recursive https://github.com/zsh-users/zsh-completions.git external\[dq]
|
|
zplugin snippet PZTM::completion
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]\f[BI]F&A:\f[B]\f[R] What is \f[C]zstyle\f[R]?
|
|
.PP
|
|
Read
|
|
zstyle (http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzutil-Module)
|
|
doc (more: What does \f[C]zstyle\f[R]
|
|
do? (https://unix.stackexchange.com/questions/214657/what-does-zstyle-do)).
|
|
Migration from Zgen
|
|
.PP
|
|
\f[B]Oh My Zsh\f[R]
|
|
.PP
|
|
More reference: check \f[B]Migration from Oh-My-ZSH\f[R]
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# Load ohmyzsh base
|
|
zgen oh-my-zsh
|
|
zinit snippet OMZL::<ALL OF THEM>
|
|
|
|
# Load ohmyzsh plugins
|
|
zgen oh-my-zsh <PATH>
|
|
zinit snippet OMZ::<PATH>
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]Prezto\f[R]
|
|
.PP
|
|
More reference: check \f[B]Migration from Prezto\f[R]
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# Load Prezto
|
|
zgen prezto
|
|
zinit snippet PZTM::<COMMENT\[aq]s List> # environment terminal editor history directory spectrum utility completion prompt
|
|
|
|
# Load prezto plugins
|
|
zgen prezto <modulename>
|
|
zinit snippet PZTM::<modulename>
|
|
|
|
# Load a repo as Prezto plugins
|
|
zgen pmodule <reponame> <branch>
|
|
zinit ice ver\[dq]<branch>\[dq]
|
|
zinit load <repo/plugin>
|
|
|
|
# Set prezto options
|
|
zgen prezto <modulename> <option> <value(s)>
|
|
zstyle \[aq]:prezto:<modulename>:\[aq] <option> <values(s)> # Set original prezto style
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]General\f[R]
|
|
.PP
|
|
\f[C]location\f[R]: refer Selection of Files
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zgen load <repo> [location] [branch]
|
|
|
|
zinit ice ver\[dq][branch]\[dq]
|
|
zinit load <repo>
|
|
\f[R]
|
|
.fi
|
|
Migration from Zplug
|
|
.PP
|
|
\f[B]Basic\f[R]
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zplug <repo/plugin>, tag1:<option1>, tag2:<option2>
|
|
|
|
zinit ice tag1\[dq]<option1>\[dq] tag2\[dq]<option2>\[dq]
|
|
zinit load <repo/plugin>
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
\f[B]Tag comparison\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]as\f[R] => \f[C]as\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]use\f[R] => \f[C]pick\f[R], \f[C]src\f[R], \f[C]multisrc\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]ignore\f[R] => None
|
|
.IP \[bu] 2
|
|
\f[C]from\f[R] => \f[C]from\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]at\f[R] => \f[C]ver\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]rename-to\f[R] => \f[C]mv\f[R], \f[C]cp\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]dir\f[R] => Selection(\f[C]pick\f[R], \&...) with rename
|
|
.IP \[bu] 2
|
|
\f[C]if\f[R] => \f[C]if\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]hook-build\f[R] => \f[C]atclone\f[R], \f[C]atpull\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]hook-load\f[R] => \f[C]atload\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]frozen\f[R] => None
|
|
.IP \[bu] 2
|
|
\f[C]on\f[R] => None
|
|
.IP \[bu] 2
|
|
\f[C]defer\f[R] => \f[C]wait\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]lazy\f[R] => \f[C]autoload\f[R]
|
|
.IP \[bu] 2
|
|
\f[C]depth\f[R] => \f[C]depth\f[R]
|
|
.SS More Examples
|
|
.PP
|
|
After installing Zinit you can start adding some actions (load some
|
|
plugins) to \f[C]\[ti]/.zshrc\f[R], at bottom.
|
|
Some examples:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# Load the pure theme, with zsh-async library that\[aq]s bundled with it.
|
|
zinit ice pick\[dq]async.zsh\[dq] src\[dq]pure.zsh\[dq]
|
|
zinit light sindresorhus/pure
|
|
|
|
# A glance at the new for-syntax \[en] load all of the above
|
|
# plugins with a single command. For more information see:
|
|
# https://zdharma-continuum.github.io/zinit/wiki/For-Syntax/
|
|
zinit for \[rs]
|
|
light-mode zsh-users/zsh-autosuggestions \[rs]
|
|
light-mode zdharma-continuum/fast-syntax-highlighting \[rs]
|
|
zdharma-continuum/history-search-multi-word \[rs]
|
|
light-mode pick\[dq]async.zsh\[dq] src\[dq]pure.zsh\[dq] \[rs]
|
|
sindresorhus/pure
|
|
|
|
# Binary release in archive, from GitHub-releases page.
|
|
# After automatic unpacking it provides program \[dq]fzf\[dq].
|
|
zinit ice from\[dq]gh-r\[dq] as\[dq]program\[dq]
|
|
zinit light junegunn/fzf
|
|
|
|
# One other binary release, it needs renaming from \[ga]docker-compose-Linux-x86_64\[ga].
|
|
# This is done by ice-mod \[ga]mv\[aq]{from} -> {to}\[aq]. There are multiple packages per
|
|
# single version, for OS X, Linux and Windows \[en] so ice-mod \[ga]bpick\[aq] is used to
|
|
# select Linux package \[en]\ in this case this is actually not needed, Zinit will
|
|
# grep operating system name and architecture automatically when there\[aq]s no \[ga]bpick\[aq].
|
|
zinit ice from\[dq]gh-r\[dq] as\[dq]program\[dq] mv\[dq]docker* -> docker-compose\[dq] bpick\[dq]*linux*\[dq]
|
|
zinit load docker/compose
|
|
|
|
# Vim repository on GitHub \[en] a typical source code that needs compilation \[en] Zinit
|
|
# can manage it for you if you like, run \[ga]./configure\[ga] and other \[ga]make\[ga], etc. stuff.
|
|
# Ice-mod \[ga]pick\[ga] selects a binary program to add to $PATH. You could also install the
|
|
# package under the path $ZPFX, see: https://zdharma-continuum.github.io/zinit/wiki/Compiling-programs
|
|
zinit ice as\[dq]program\[dq] atclone\[dq]rm -f src/auto/config.cache; ./configure\[dq] \[rs]
|
|
atpull\[dq]%atclone\[dq] make pick\[dq]src/vim\[dq]
|
|
zinit light vim/vim
|
|
|
|
# Scripts that are built at install (there\[aq]s single default make target, \[dq]install\[dq],
|
|
# and it constructs scripts by \[ga]cat\[aq]ing a few files). The make\[aq]\[aq] ice could also be:
|
|
# \[ga]make\[dq]install PREFIX=$ZPFX\[dq]\[ga], if \[dq]install\[dq] wouldn\[aq]t be the only, default target.
|
|
zinit ice as\[dq]program\[dq] pick\[dq]$ZPFX/bin/git-*\[dq] make\[dq]PREFIX=$ZPFX\[dq]
|
|
zinit light tj/git-extras
|
|
|
|
# Handle completions without loading any plugin, see \[dq]clist\[dq] command.
|
|
# This one is to be ran just once, in interactive session.
|
|
zinit creinstall %HOME/my_completions
|
|
\f[R]
|
|
.fi
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# For GNU ls (the binaries can be gls, gdircolors, e.g. on OS X when installing the
|
|
# coreutils package from Homebrew; you can also use https://github.com/ogham/exa)
|
|
zinit ice atclone\[dq]dircolors -b LS_COLORS > c.zsh\[dq] atpull\[aq]%atclone\[aq] pick\[dq]c.zsh\[dq] nocompile\[aq]!\[aq]
|
|
zinit light trapd00r/LS_COLORS
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
You can see an extended explanation of LS_COLORS in the
|
|
Wiki. (https://zdharma-continuum.github.io/zinit/wiki/LS_COLORS-explanation/)
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# make\[aq]!...\[aq] -> run make before atclone & atpull
|
|
zinit ice as\[dq]program\[dq] make\[aq]!\[aq] atclone\[aq]./direnv hook zsh > zhook.zsh\[aq] atpull\[aq]%atclone\[aq] src\[dq]zhook.zsh\[dq]
|
|
zinit light direnv/direnv
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
You can see an extended explanation of direnv in the
|
|
Wiki. (https://zdharma-continuum.github.io/zinit/wiki/Direnv-explanation/)
|
|
.PP
|
|
If you\[cq]re interested in more examples then check out the
|
|
zinit-configs
|
|
repository (https://github.com/zdharma-continuum/zinit-configs) where
|
|
users have uploaded their \f[C]\[ti]/.zshrc\f[R] and Zinit
|
|
configurations.
|
|
Feel free to
|
|
submit (https://github.com/zdharma-continuum/zinit-configs/issues/new?template=request-to-add-zshrc-to-the-zinit-configs-repo.md)
|
|
your \f[C]\[ti]/.zshrc\f[R] there if it contains Zinit commands.
|
|
.PP
|
|
You can also check out the Gallery of Zinit
|
|
Invocations (https://zdharma-continuum.github.io/zinit/wiki/GALLERY/)
|
|
for some additional examples.
|
|
.PP
|
|
Also, two articles on the Wiki present an example setup
|
|
here (https://zdharma-continuum.github.io/zinit/wiki/Example-Minimal-Setup/)
|
|
and
|
|
here (https://zdharma-continuum.github.io/zinit/wiki/Example-Oh-My-Zsh-setup/).
|
|
.SH How to Use
|
|
.SS Ice Modifiers
|
|
.PP
|
|
Following \f[C]ice\f[R] modifiers are to be
|
|
passed (https://zdharma-continuum.github.io/zinit/wiki/Alternate-Ice-Syntax/)
|
|
to \f[C]zinit ice ...\f[R] to obtain described effects.
|
|
The word \f[C]ice\f[R] means something that\[cq]s added (like ice to a
|
|
drink) \[en] and in Zinit it means adding modifier to a next
|
|
\f[C]zinit\f[R] command, and also something that\[cq]s temporary because
|
|
it melts \[en] and this means that the modification will last only for a
|
|
\f[B]single\f[R] next \f[C]zinit\f[R] command.
|
|
.PP
|
|
Some Ice-modifiers are highlighted and clicking on them will take you to
|
|
the appropriate Wiki page for an extended explanation.
|
|
.PP
|
|
You may safely assume a given ice works with both plugins and snippets
|
|
unless explicitly stated otherwise.
|
|
.SS Cloning Options
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Modifier
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]proto\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]from\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/Private-Repositories/)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]ver\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]bpick\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]depth\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cloneopts\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]pullopts\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]svn\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Selection of Files (To Source, \&...)
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Modifier
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[B]\f[CB]pick\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/Sourcing-multiple-files/)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]src\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/Sourcing-multiple-files)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]multisrc\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/Sourcing-multiple-files)
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Conditional Loading
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Modifier
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[B]\f[CB]wait\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/Example-wait-conditions)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]load\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/Multiple-prompts)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]unload\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/Multiple-prompts)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cloneonly\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]if\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]has\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]subscribe\f[R] / \f[C]on-update-of\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]trigger-load\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Plugin Output
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Modifier
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]silent\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]lucid\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]notify\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Completions
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Modifier
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]blockf\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]nocompletions\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Command Execution After Cloning, Updating or Loading
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Modifier
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]mv\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cp\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]atclone\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/atload-and-other-at-ices)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]atpull\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/atload-and-other-at-ices)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]atinit\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/atload-and-other-at-ices)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]atload\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/atload-and-other-at-ices)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]run-atpull\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]nocd\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]make\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/Installing-with-make)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]countdown\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]reset\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Sticky-Emulation Of Other Shells
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Modifier
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]sh\f[R], \f[C]!sh\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]bash\f[R], \f[C]!bash\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]ksh\f[R], \f[C]!ksh\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]csh\f[R], \f[C]!csh\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Others
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Modifier
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]as\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]id-as\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/id-as/)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]compile\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]nocompile\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]service\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]reset-prompt\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]bindmap\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]trackbinds\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]wrap-track\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/wrap-track)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]aliases\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]light-mode\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[B]\f[CB]extract\f[B]\f[R] (https://zdharma-continuum.github.io/zinit/wiki/extract-Ice/)
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]subst\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]autoload\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Order of Execution
|
|
.PP
|
|
Order of execution of related Ice-mods: \f[C]atinit\f[R] ->
|
|
\f[C]atpull!\f[R] -> \f[C]make\[aq]!!\[aq]\f[R] -> \f[C]mv\f[R] ->
|
|
\f[C]cp\f[R] -> \f[C]make!\f[R] -> \f[C]atclone\f[R]/\f[C]atpull\f[R] ->
|
|
\f[C]make\f[R] -> \f[C](plugin script loading)\f[R] -> \f[C]src\f[R] ->
|
|
\f[C]multisrc\f[R] -> \f[C]atload\f[R].
|
|
.SS Zinit Commands
|
|
.PP
|
|
Following commands are passed to \f[C]zinit ...\f[R] to obtain described
|
|
effects.
|
|
.SS Help
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Command
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]-h, --help, help\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]man\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Loading and Unloading
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Command
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]load {plg-spec}\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]light [-b] {plg-spec}\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]unload [-q] {plg-spec}\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]snippet [-f] {url}\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Completions
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Command
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
clist [\f[I]columns\f[R]], completions [\f[I]columns\f[R]]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cdisable {cname}\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cenable {cname}\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]creinstall [-q] [-Q] {plg-spec}\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cuninstall {plg-spec}\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]csearch\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]compinit\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cclear\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cdlist\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cdreplay [-q]\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cdclear [-q]\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Tracking of the Active Session
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Command
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]dtrace, dstart\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]dstop\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]dunload\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]dreport\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]dclear\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Reports and Statistics
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Command
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]times [-s] [-m]\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]zstatus\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]report {plg-spec}\[rs]|--all\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]loaded [keyword], list [keyword]\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]ls\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]status {plg-spec}\[rs]|URL\[rs]|--all\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]recently [time-spec]\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]bindkeys\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Compiling
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Command
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]compile {plg-spec}\[rs]|--all\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]uncompile {plg-spec}\[rs]|--all\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]compiled\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Other
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
c l.
|
|
T{
|
|
Command
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
\f[C]self-update\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]update [-q] [-r] {plg-spec}\[rs]|URL\[rs]|--all\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]ice <ice specification>\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]delete {plg-spec}\[rs]|URL\[rs]|--clean\[rs]|--all\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]cd {plg-spec}\f[R]
|
|
T}@T{
|
|
T}
|
|
T{
|
|
\f[C]edit {plg-spec}\f[R]
|
|
T}@T{
|
|
T}
|
|
.TE
|
|
.SS Updating Zinit and Plugins
|
|
.PP
|
|
To update Zinit issue \f[C]zinit self-update\f[R] in the command line.
|
|
.PP
|
|
To update all plugins and snippets, issue \f[C]zinit update\f[R].
|
|
If you wish to update only a single plugin/snippet instead issue
|
|
\f[C]zinit update NAME_OF_PLUGIN\f[R].
|
|
A list of commits will be shown:
|
|
.PP
|
|
Some plugins require performing an action each time they\[cq]re updated.
|
|
One way you can do this is by using the \f[C]atpull\f[R] ice modifier.
|
|
For example, writing \f[C]zinit ice atpull\[aq]./configure\[aq]\f[R]
|
|
before loading a plugin will execute \f[C]./configure\f[R] after a
|
|
successful update.
|
|
Refer to Ice Modifiers for more information.
|
|
.PP
|
|
The ice modifiers for any plugin or snippet are stored in their
|
|
directory in a \f[C]._zinit\f[R] subdirectory, hence the plugin
|
|
doesn\[cq]t have to be loaded to be correctly updated.
|
|
There\[cq]s one other file created there, \f[C].zinit_lstupd\f[R] \[en]
|
|
it holds the log of the new commits pulled-in in the last update.
|
|
.SH Completions
|
|
.SS Calling \f[C]compinit\f[R] Without Turbo Mode
|
|
.PP
|
|
With no Turbo mode in use, compinit can be called normally, i.e.: as
|
|
\f[C]autoload compinit; compinit\f[R].
|
|
This should be done after loading of all plugins and before possibly
|
|
calling \f[C]zinit cdreplay\f[R].
|
|
.PP
|
|
The \f[C]cdreplay\f[R] subcommand is provided to re-play all catched
|
|
\f[C]compdef\f[R] calls.
|
|
The \f[C]compdef\f[R] calls are used to define a completion for a
|
|
command.
|
|
For example, \f[C]compdef _git git\f[R] defines that the \f[C]git\f[R]
|
|
command should be completed by a \f[C]_git\f[R] function.
|
|
.PP
|
|
The \f[C]compdef\f[R] function is provided by \f[C]compinit\f[R] call.
|
|
As it should be called later, after loading all of the plugins, Zinit
|
|
provides its own \f[C]compdef\f[R] function that catches (i.e.: records
|
|
in an array) the arguments of the call, so that the loaded plugins can
|
|
freely call \f[C]compdef\f[R].
|
|
Then, the \f[C]cdreplay\f[R] (\f[I]compdef-replay\f[R]) can be used,
|
|
after \f[C]compinit\f[R] will be called (and the original
|
|
\f[C]compdef\f[R] function will become available), to execute all
|
|
detected \f[C]compdef\f[R] calls.
|
|
To summarize:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
ZINIT_HOME=\[dq]${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git\[dq]
|
|
source \[dq]${ZINIT_HOME}/zinit.zsh\[dq]
|
|
|
|
zinit load \[dq]some/plugin\[dq]
|
|
\&...
|
|
compdef _gnu_generic fd # this will be intercepted by Zinit, because as the compinit
|
|
# isn\[aq]t yet loaded, thus there\[aq]s no such function \[ga]compdef\[aq]; yet
|
|
# Zinit provides its own \[ga]compdef\[aq] function which saves the
|
|
# completion-definition for later possible re-run with \[ga]zinit
|
|
# cdreplay\[aq] or \[ga]zicdreplay\[aq] (the second one can be used in hooks
|
|
# like atload\[aq]\[aq], atinit\[aq]\[aq], etc.)
|
|
\&...
|
|
zinit load \[dq]other/plugin\[dq]
|
|
|
|
autoload -Uz compinit
|
|
compinit
|
|
|
|
zinit cdreplay -q # -q is for quiet; actually run all the \[ga]compdef\[aq]s saved before
|
|
#\[ga]compinit\[ga] call (\[ga]compinit\[aq] declares the \[ga]compdef\[aq] function, so
|
|
# it cannot be used until \[ga]compinit\[aq] is ran; Zinit solves this
|
|
# via intercepting the \[ga]compdef\[aq]-calls and storing them for later
|
|
# use with \[ga]zinit cdreplay\[aq])
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
This allows to call compinit once.
|
|
Performance gains are huge, example shell startup time with double
|
|
\f[C]compinit\f[R]: \f[B]0.980\f[R] sec, with \f[C]cdreplay\f[R] and
|
|
single \f[C]compinit\f[R]: \f[B]0.156\f[R] sec.
|
|
.SS Calling \f[C]compinit\f[R] With Turbo Mode
|
|
.PP
|
|
If you load completions using \f[C]wait\[aq]\[aq]\f[R] Turbo mode then
|
|
you can add \f[C]atinit\[aq]zicompinit\[aq]\f[R] to syntax-highlighting
|
|
plugin (which should be the last one loaded, as their (2 projects,
|
|
z-sy-h (https://github.com/zsh-users/zsh-syntax-highlighting) &
|
|
f-sy-h (https://github.com/zdharma-continuum/fast-syntax-highlighting))
|
|
documentation state), or \f[C]atload\[aq]zicompinit\[aq]\f[R] to last
|
|
completion-related plugin.
|
|
\f[C]zicompinit\f[R] is a function that just runs
|
|
\f[C]autoload compinit; compinit\f[R], created for convenience.
|
|
There\[cq]s also \f[C]zicdreplay\f[R] which will replay any caught
|
|
compdefs so you can also do:
|
|
\f[C]atinit\[aq]zicompinit; zicdreplay\[aq]\f[R], etc.
|
|
Basically, the whole topic is the same as normal \f[C]compinit\f[R]
|
|
call, but it is done in \f[C]atinit\f[R] or \f[C]atload\f[R] hook of the
|
|
last related plugin with use of the helper functions
|
|
(\f[C]zicompinit\f[R],\f[C]zicdreplay\f[R] & \f[C]zicdclear\f[R] \[en]
|
|
see below for explanation of the last one).
|
|
To summarize:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
ZINIT_HOME=\[dq]${XDG_DATA_HOME:-${HOME}/.local/share/zinit}\[dq]
|
|
source \[dq]${ZINIT_HOME}/zinit.zsh\[dq]
|
|
|
|
# Load using the for-syntax
|
|
zinit wait lucid for \[rs]
|
|
\[dq]some/plugin\[dq]
|
|
zinit wait lucid for \[rs]
|
|
\[dq]other/plugin\[dq]
|
|
|
|
zinit wait lucid atload\[dq]zicompinit; zicdreplay\[dq] blockf for \[rs]
|
|
zsh-users/zsh-completions
|
|
\f[R]
|
|
.fi
|
|
.SS Ignoring Compdefs
|
|
.PP
|
|
If you want to ignore compdefs provided by some plugins or snippets,
|
|
place their load commands before commands loading other plugins or
|
|
snippets, and issue \f[C]zinit cdclear\f[R] (or \f[C]zicdclear\f[R],
|
|
designed to be used in hooks like \f[C]atload\[aq]\[aq]\f[R]):
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
ZINIT_HOME=\[dq]${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git\[dq]
|
|
source \[dq]${ZINIT_HOME}/zinit.zsh\[dq]
|
|
|
|
zinit snippet OMZP::git
|
|
zinit cdclear -q # <- forget completions provided by Git plugin
|
|
|
|
zinit load \[dq]some/plugin\[dq]
|
|
\&...
|
|
zinit load \[dq]other/plugin\[dq]
|
|
|
|
autoload -Uz compinit
|
|
compinit
|
|
zinit cdreplay -q # <- execute compdefs provided by rest of plugins
|
|
zinit cdlist # look at gathered compdefs
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
The \f[C]cdreplay\f[R] is important if you use plugins like
|
|
\f[C]OMZP::kubectl\f[R] or \f[C]asdf-vm/asdf\f[R], because these plugins
|
|
call \f[C]compdef\f[R].
|
|
.SS Disabling System-Wide \f[C]compinit\f[R] Call (Ubuntu)
|
|
.PP
|
|
On Ubuntu users might get surprised that e.g.\ their completions work
|
|
while they didn\[cq]t call \f[C]compinit\f[R] in their \f[C].zshrc\f[R].
|
|
That\[cq]s because the function is being called in \f[C]/etc/zshrc\f[R].
|
|
To disable this call \[en] what is needed to avoid the slowdown and if
|
|
user loads any completion-equipped plugins, i.e.\ almost on 100% \[en]
|
|
add the following lines to \f[C]\[ti]/.zshenv\f[R]:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
# Skip the not really helping Ubuntu global compinit
|
|
skip_global_compinit=1
|
|
\f[R]
|
|
.fi
|
|
.SH Zinit Module
|
|
.PP
|
|
The module is now hosted in its own
|
|
repository (https://github.com/zdharma-continuum/zinit-module)
|
|
.SH Hints and Tips
|
|
.SS Customizing Paths
|
|
.PP
|
|
Following variables can be set to custom values, before sourcing Zinit.
|
|
The previous global variables like \f[C]$ZPLG_HOME\f[R] have been
|
|
removed to not pollute the namespace \[en]\ there\[cq]s single
|
|
\f[C]$ZINIT\f[R] hash instead of \f[C]8\f[R] string variables.
|
|
Please update your dotfiles.
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
declare -A ZINIT # initial Zinit\[aq]s hash definition, if configuring before loading Zinit, and then:
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
.TS
|
|
tab(@);
|
|
lw(5.7n) lw(64.3n).
|
|
T{
|
|
Hash Field
|
|
T}@T{
|
|
Description
|
|
T}
|
|
_
|
|
T{
|
|
ZINIT[BIN_DIR]
|
|
T}@T{
|
|
Where Zinit code resides, e.g.:
|
|
\[lq]\[ti]/.local/share/zinit/zinit.git\[rq]
|
|
T}
|
|
T{
|
|
ZINIT[HOME_DIR]
|
|
T}@T{
|
|
Where Zinit should create all working directories, e.g.:
|
|
\[lq]\[ti]/.local/share/zinit\[rq]
|
|
T}
|
|
T{
|
|
ZINIT[MAN_DIR]
|
|
T}@T{
|
|
Directory where plugins can store their manpages
|
|
(\f[C]atclone\[dq]cp -vf myplugin.1 $ZINIT[MAN_DIR]/man1\[dq]\f[R]).
|
|
If overridden, this directory will not necessarily be used by
|
|
\f[C]man\f[R] (See #8).
|
|
Default: \f[C]$ZPFX/man\f[R]
|
|
T}
|
|
T{
|
|
ZINIT[PLUGINS_DIR]
|
|
T}@T{
|
|
Override single working directory \[en] for plugins,
|
|
e.g.\ \[lq]/opt/zsh/zinit/plugins\[rq]
|
|
T}
|
|
T{
|
|
ZINIT[COMPLETIONS_DIR]
|
|
T}@T{
|
|
As above, but for completion files,
|
|
e.g.\ \[lq]/opt/zsh/zinit/root_completions\[rq]
|
|
T}
|
|
T{
|
|
ZINIT[SNIPPETS_DIR]
|
|
T}@T{
|
|
As above, but for snippets
|
|
T}
|
|
T{
|
|
ZINIT[ZCOMPDUMP_PATH]
|
|
T}@T{
|
|
Path to \f[C].zcompdump\f[R] file, with the file included (i.e.\ its
|
|
name can be different)
|
|
T}
|
|
T{
|
|
ZINIT[COMPINIT_OPTS]
|
|
T}@T{
|
|
Options for \f[C]compinit\f[R] call (i.e.\ done by
|
|
\f[C]zicompinit\f[R]), use to pass -C to speed up loading
|
|
T}
|
|
T{
|
|
ZINIT[MUTE_WARNINGS]
|
|
T}@T{
|
|
If set to \f[C]1\f[R], then mutes some of the Zinit warnings,
|
|
specifically the \f[C]plugin already registered\f[R] warning
|
|
T}
|
|
T{
|
|
ZINIT[OPTIMIZE_OUT_DISK_ACCESSES]
|
|
T}@T{
|
|
If set to \f[C]1\f[R], then Zinit will skip checking if a Turbo-loaded
|
|
object exists on the disk.
|
|
By default Zinit skips Turbo for non-existing objects (plugins or
|
|
snippets) to install them before the first prompt \[en] without any
|
|
delays, during the normal processing of \f[C]zshrc\f[R].
|
|
This option can give a performance gain of about 10 ms out of 150 ms
|
|
(i.e.: Zsh will start up in 140 ms instead of 150 ms).
|
|
T}
|
|
T{
|
|
ZINIT[NO_ALIASES]
|
|
T}@T{
|
|
If set to \f[C]1\f[R], then Zinit will not set aliases such as \f[C]zi\f[R] or \f[C]zini\f[R]
|
|
T}
|
|
.TE
|
|
.PP
|
|
There is also \f[C]$ZPFX\f[R], set by default to
|
|
\f[C]\[ti]/.local/share/zinit/polaris\f[R] \[en] a directory where
|
|
software with \f[C]Makefile\f[R], etc.
|
|
can be pointed to, by
|
|
e.g.\ \f[C]atclone\[aq]./configure --prefix=$ZPFX\[aq]\f[R].
|
|
.SS Non-GitHub (Local) Plugins
|
|
.PP
|
|
Use \f[C]create\f[R] subcommand with user name \f[C]_local\f[R] (the
|
|
default) to create plugin\[cq]s skeleton in
|
|
\f[C]$ZINIT[PLUGINS_DIR]\f[R].
|
|
It will be not connected with GitHub repository (because of user name
|
|
being \f[C]_local\f[R]).
|
|
To enter the plugin\[cq]s directory use \f[C]cd\f[R] command with just
|
|
plugin\[cq]s name (without \f[C]_local\f[R], it\[cq]s optional).
|
|
.PP
|
|
If user name will not be \f[C]_local\f[R], then Zinit will create
|
|
repository also on GitHub and setup correct repository origin.
|
|
.SS Extending Git
|
|
.PP
|
|
There are several projects that provide git extensions.
|
|
Installing them with Zinit has many benefits:
|
|
.IP \[bu] 2
|
|
all files are under \f[C]$HOME\f[R] \[en] no administrator rights
|
|
needed,
|
|
.IP \[bu] 2
|
|
declarative setup (like Chef or Puppet) \[en] copying \f[C].zshrc\f[R]
|
|
to different account brings also git-related setup,
|
|
.IP \[bu] 2
|
|
easy update by e.g.\ \f[C]zinit update --all\f[R].
|
|
.PP
|
|
Below is a configuration that adds multiple git extensions, loaded in
|
|
Turbo mode, 1 second after prompt, with use of the
|
|
Bin-Gem-Node (https://github.com/zdharma-continuum/zinit-annex-bin-gem-node)
|
|
annex:
|
|
.IP
|
|
.nf
|
|
\f[C]
|
|
zinit as\[dq]null\[dq] wait\[dq]1\[dq] lucid for \[rs]
|
|
sbin Fakerr/git-recall \[rs]
|
|
sbin cloneopts paulirish/git-open \[rs]
|
|
sbin paulirish/git-recent \[rs]
|
|
sbin davidosomething/git-my \[rs]
|
|
sbin atload\[dq]export _MENU_THEME=legacy\[dq] \[rs]
|
|
arzzen/git-quick-stats \[rs]
|
|
sbin iwata/git-now \[rs]
|
|
make\[dq]PREFIX=$ZPFX install\[dq] \[rs]
|
|
tj/git-extras \[rs]
|
|
sbin\[dq]git-url;git-guclone\[dq] make\[dq]GITURL_NO_CGITURL=1\[dq] \[rs]
|
|
zdharma-continuum/git-url
|
|
\f[R]
|
|
.fi
|
|
.PP
|
|
Target directory for installed files is \f[C]$ZPFX\f[R]
|
|
(\f[C]\[ti]/.local/share/zinit/polaris\f[R] by default).
|
|
.SH Supporting
|
|
.PP
|
|
Zinit is a personal, free-time project with no funding and a huge
|
|
feature request
|
|
backlog (https://github.com/zdharma-continuum/zinit/issues).
|
|
If you love it, consider supporting its development via GitHub Sponsors
|
|
[pending].
|
|
Any help counts!
|
|
.SH Getting Help and Community
|
|
.PP
|
|
Do you need help or wish to get in touch with other Zinit users?
|
|
.IP \[bu] 2
|
|
Open a
|
|
discussion (https://github.com/zdharma-continuum/zinit/discussions).
|
|
.IP \[bu] 2
|
|
Or via reach out via Gitter [IMAGE: Join the chat at
|
|
https://gitter.im/zdharma-continuum/community (https://badges.gitter.im/zdharma-continuum/zinit.svg)] (https://gitter.im/zdharma-continuum/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|