zi ice depth'1'
zi light z-shell/nbStandard syntax + Bin Gem Node
zi ice depth'1' sbin'bin/*'
zi light z-shell/nbzi wait lucid for \
depth'1' sbin'bin/*' \
z-shell/nbZi package
zi pack for nbThe package installed locally into a plugin directory and provided to the command line through shims, i.e.: automatic forwarder scripts created under
$ZPFX/bin(which is added to the$PATHby default; shims are also a bin-gem-node annex feature).
nb writes its notebooks and configuration under $HOME by default. This
plugin exports NBRC_PATH, NB_DIR, and NB_HIST with
XDG Base Directory
defaults instead, but only when you have not already set the variable
yourself and its legacy $HOME path does not already exist. An
existing ~/.nbrc or ~/.nb install keeps working exactly as before;
only a fresh install gets XDG-compliant paths.
To use your own paths, export the variable anywhere that runs before the
plugin loads (.zshenv, .zshrc, an atinit ice, anything):
NB_DIR="${HOME}/Notes" # wins over the XDG default
zi ice depth'1' sbin'bin/*'
zi light z-shell/nb| Variable | XDG default | Skipped when this already exists |
|---|---|---|
NBRC_PATH |
${XDG_CONFIG_HOME:-$HOME/.config}/nb/nbrc |
~/.nbrc |
NB_DIR |
${XDG_DATA_HOME:-$HOME/.local/share}/nb |
~/.nb |
NB_HIST |
${XDG_STATE_HOME:-$HOME/.local/state}/nb/history |
~/.nb_history |
Every other nb variable (editor, theme, sync, encryption tool, and so
on) is already picked up the same way by nb itself: export it before
nb runs and it takes effect. See
nb's variables reference for the
full list.
The defaulting logic lives in
nb.plugin.zsh itself. It needs no ice of its own
and no .zshrc boilerplate beyond the recipes above.
The recipes deliberately do not use as'program'. That mode makes
Zi skip nb.plugin.zsh entirely, so the plugin can set neither these
defaults nor $PATH. It is also unnecessary: the plugin adds its own
bin/ to $PATH whenever the plugin manager does not (a $PMSPEC
without b, which is Zi's case). Installing with as'program' opts you
out of the plugin body, and you have to set the variables yourself.
zi pack for nb is the one install path these defaults do not reach. It
installs xwmx/nb upstream directly, not
this plugin, so there is no nb.plugin.zsh in the checkout to load.
Use one of the recipes above if you want the XDG defaults.
Clone repostory and add
nbto your plugin list.
git clone https://github.com/z-shell/nb.git \
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/nbAdd the following to your
.zshrcfile in the same place you're doing your otherzgen loadcalls in.
zgen load z-shell/nb

