|
|
|
@ -170,8 +170,8 @@ The `zimfw` plugin manager installs your modules at `${ZIM_HOME}/modules`, and |
|
|
|
|
builds a static script at `${ZIM_HOME}/init.zsh` that will initialize them. Your |
|
|
|
|
modules are defined in your `~/.zimrc` file. |
|
|
|
|
|
|
|
|
|
The `~/.zimrc` file must contain a `zmodule` call for each module you want to |
|
|
|
|
use. The modules will be initialized in the order they are defined. |
|
|
|
|
The `~/.zimrc` file must contain `zmodule` calls to define the modules to be |
|
|
|
|
initialized. The initialization will be done in the same order it's defined. |
|
|
|
|
|
|
|
|
|
The `~/.zimrc` file is not sourced during Zsh startup, and it's only used to |
|
|
|
|
configure the `zimfw` plugin manager. |
|
|
|
@ -192,28 +192,48 @@ Below are some usage examples: |
|
|
|
|
`zmodule spaceship-prompt/spaceship-prompt --source spaceship.zsh --no-submodules` or |
|
|
|
|
`zmodule spaceship-prompt/spaceship-prompt --name spaceship --no-submodules` |
|
|
|
|
* A module with two custom initialization files: |
|
|
|
|
`zmodule sindresorhus/pure --source async.zsh --source pure.zsh` |
|
|
|
|
`zmodule sindresorhus/pure --source async.zsh --source pure.zsh`. Separate |
|
|
|
|
zmodule calls can also be used. In this equivalent example, the second call |
|
|
|
|
automatically discovers the second file to be sourced: |
|
|
|
|
``` |
|
|
|
|
zmodule sindresorhus/pure --source async.zsh |
|
|
|
|
zmodule sindresorhus/pure |
|
|
|
|
``` |
|
|
|
|
* A module with a custom initialization command: |
|
|
|
|
`zmodule skywind3000/z.lua --cmd 'eval "$(lua {}/z.lua --init zsh enhanced once)"'` |
|
|
|
|
* A module with an on-pull command. It can be used to create a cached initialization script: |
|
|
|
|
`zmodule skywind3000/z.lua --on-pull 'lua z.lua --init zsh enhanced once >! init.zsh'` |
|
|
|
|
* A module with a big git repository: `zmodule romkatv/powerlevel10k --use degit` |
|
|
|
|
* A module with a custom root subdirectory: `zmodule ohmyzsh/ohmyzsh --root plugins/vim-interaction` |
|
|
|
|
* A module with multiple roots: |
|
|
|
|
``` |
|
|
|
|
zmodule sorin-ionescu/prezto --root modules/command-not-found |
|
|
|
|
zmodule sorin-ionescu/prezto --root modules/gnu-utility |
|
|
|
|
``` |
|
|
|
|
or |
|
|
|
|
``` |
|
|
|
|
zmodule ohmyzsh/ohmyzsh --root plugins/perl |
|
|
|
|
zmodule ohmyzsh/ohmyzsh --root plugins/vim-interaction |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
<details id="zmodule-usage"> |
|
|
|
|
<summary>Want help with the complete <code>zmodule</code> usage?</summary> |
|
|
|
|
|
|
|
|
|
<pre>Usage: <b>zmodule</b> <url> [<b>-n</b>|<b>--name</b> <module_name>] [options] |
|
|
|
|
<pre>Usage: <b>zmodule</b> <url> [<b>-n</b>|<b>--name</b> <module_name>] [<b>-r</b>|<b>--root</b> <path>] [options] |
|
|
|
|
|
|
|
|
|
Add <b>zmodule</b> calls to your <b>~/.zimrc</b> file to define the modules to be initialized. The modules |
|
|
|
|
are initialized in the same order they are defined. |
|
|
|
|
Add <b>zmodule</b> calls to your <b>~/.zimrc</b> file to define the modules to be initialized. The initiali- |
|
|
|
|
zation will be done in the same order it's defined. |
|
|
|
|
|
|
|
|
|
<url> Module absolute path or repository URL. The following URL formats |
|
|
|
|
are equivalent: <b>foo</b>, <b>zimfw/foo</b>, <b>https://github.com/zimfw/foo.git</b>. |
|
|
|
|
<b>-n</b>|<b>--name</b> <module_name> Set a custom module name. Default: the last component in <url>. |
|
|
|
|
Use slashes inside the name to organize the module into subdirec- |
|
|
|
|
tories. |
|
|
|
|
|
|
|
|
|
Repository options: |
|
|
|
|
If an absolute path is given, the module is considered externally |
|
|
|
|
installed, and won't be installed or updated by zimfw. |
|
|
|
|
<b>-n</b>|<b>--name</b> <module_name> Set a custom module name. Use slashes inside the name to organize |
|
|
|
|
the module into subdirectories. The module will be installed at |
|
|
|
|
<b>${ZIM_HOME}/</b><module_name>. Default: the last component in <url>. |
|
|
|
|
<b>-r</b>|<b>--root</b> <path> Relative path to the module root. |
|
|
|
|
|
|
|
|
|
Per-module options: |
|
|
|
|
<b>-b</b>|<b>--branch</b> <branch_name> Use specified branch when installing and updating the module. |
|
|
|
|
Overrides the tag option. Default: the repository default branch. |
|
|
|
|
<b>-t</b>|<b>--tag</b> <tag_name> Use specified tag when installing and updating the module. Over- |
|
|
|
@ -227,26 +247,36 @@ Repository options: |
|
|
|
|
changes are lost on updates. Git submodules are not supported. |
|
|
|
|
<b>--no-submodules</b> Don't install or update git submodules. |
|
|
|
|
<b>-z</b>|<b>--frozen</b> Don't install or update the module. |
|
|
|
|
|
|
|
|
|
The per-module options above are carried over multiple zmodule calls for the same module. |
|
|
|
|
Modules are uniquely identified by their name. |
|
|
|
|
|
|
|
|
|
Per-module-root options: |
|
|
|
|
<b>--on-pull</b> <command> Execute command after installing or updating the module. The com- |
|
|
|
|
mand is executed in the module root directory. |
|
|
|
|
|
|
|
|
|
Initialization options: |
|
|
|
|
<b>-f</b>|<b>--fpath</b> <path> Add specified path to fpath. The path is relative to the module |
|
|
|
|
root directory. Default: <b>functions</b>, if the subdirectory exists. |
|
|
|
|
<b>-a</b>|<b>--autoload</b> <func_name> Autoload specified function. Default: all valid names inside the |
|
|
|
|
<b>functions</b> subdirectory, if any. |
|
|
|
|
<b>-s</b>|<b>--source</b> <file_path> Source specified file. The file path is relative to the module |
|
|
|
|
root directory. Default: <b>init.zsh</b>, if the <b>functions</b> subdirectory |
|
|
|
|
also exists, or the largest of the files with name matching |
|
|
|
|
<b>{init.zsh,module_name.{zsh,plugin.zsh,zsh-theme,sh}}</b>, if any. |
|
|
|
|
<b>-c</b>|<b>--cmd</b> <command> Execute specified command. Occurrences of the <b>{}</b> placeholder in |
|
|
|
|
the command are substituted by the module root directory path. |
|
|
|
|
<b>-d</b>|<b>--disabled</b> Don't initialize the module root or uninstall the module. |
|
|
|
|
|
|
|
|
|
The per-module-root options above are carried over multiple zmodule calls for the same mod- |
|
|
|
|
ule root. |
|
|
|
|
|
|
|
|
|
Per-call initialization options: |
|
|
|
|
<b>-f</b>|<b>--fpath</b> <path> Will add specified path to fpath. The path is relative to the |
|
|
|
|
module root directory. Default: <b>functions</b>, if the subdirectory |
|
|
|
|
exists and is non-empty. |
|
|
|
|
<b>-a</b>|<b>--autoload</b> <func_name> Will autoload specified function. Default: all valid names inside |
|
|
|
|
the <b>functions</b> subdirectory, if any. |
|
|
|
|
<b>-s</b>|<b>--source</b> <file_path> Will source specified file. The path is relative to the module |
|
|
|
|
root directory. Default: <b>init.zsh</b>, if a non-empty <b>functions</b> sub- |
|
|
|
|
directory exists, else the largest of the files matching the glob |
|
|
|
|
<b>(init.zsh|</b><root_tail><b>.(zsh|plugin.zsh|zsh-theme|sh))</b>, if any. |
|
|
|
|
<b>-c</b>|<b>--cmd</b> <command> Will execute specified command. Occurrences of the <b>{}</b> placeholder |
|
|
|
|
in the command are substituted by the module root directory path. |
|
|
|
|
I.e., <b>-s 'foo.zsh'</b> and <b>-c 'source {}/foo.zsh'</b> are equivalent. |
|
|
|
|
<b>-d</b>|<b>--disabled</b> Don't initialize or uninstall the module. |
|
|
|
|
|
|
|
|
|
Setting any initialization option above will disable all the default values from the other |
|
|
|
|
initialization options, so only your provided values are used. I.e. these values are either |
|
|
|
|
all automatic, or all manual. |
|
|
|
|
Setting any per-call initialization option above will disable the default values from the |
|
|
|
|
other per-call initialization options, so only your provided values will be used. I.e. these |
|
|
|
|
values are either all automatic, or all manual in each zmodule call. To use default values |
|
|
|
|
and also provided values, use separate zmodule calls. |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
</details> |
|
|
|
|