跳到主要内容

⚙️ Modules

z-shell/zpmod

The module is a binary Zsh module, think about the zmodload Zsh command, it's that topic, which transparently and automatically compiles sourced scripts.

Many plugin managers do not offer a compilation of plugins, the module is a solution to this. Even if a plugin manager does compile the plugin's main script (like Zi does).

Install zpmod

备注

This script can be used with most plugin managers and Zi is not required.

提示

Zi users can build the module by issuing the following command instead of running the above build.sh script.

zi module build

This command will compile the module and display instructions on what to add to ~/.zshrc.

Measuring Time of sources

Besides the compilation feature, the module also measures duration of each script sourcing.

Issue zpmod source-study after loading the module at top of ~/.zshrc to see a list of all sourced files with the time the sourcing took in milliseconds on the left.

This feature allows profiling the shell startup. Also, no script can pass through that check and you will obtain a complete list of all loaded scripts, like if Zshell itself was investigating this.

The list can be surprising.

Debugging

To enable debug messages from the module set:

typeset -g ZI_MOD_DEBUG=1

z-shell/zgdbm

Provides GDBM module as a plugin.

zstyles - The values being set are the defaults.

备注

Change the values before loading the zgdbm plugin.

~/.zshrc
zstyle ":plugin:zgdbm" cppflags "-I/usr/local/include"  # Additional include directoryzstyle ":plugin:zgdbm" cflags "-Wall -O2 -g"            # Additional CFLAGSzstyle ":plugin:zgdbm" ldflags "-L/usr/local/lib"       # Additional library directory

Install zgdbm

zi light z-shell/zgdbm