Skip to content

Latest commit

 

History

93 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo ❮ Zsh + Nb ❯

Feature-rich, next level notebook by xwmx/nb

xwmx/nb

xwmx/nb

Package source: Source Tarball Bin Git Node Gem
Status: ✔️ ✔️ ✔️


Standard syntax

zi ice depth'1'
zi light z-shell/nb

Standard syntax + Bin Gem Node

zi ice depth'1' sbin'bin/*'
zi light z-shell/nb

Turbo Mode + "For" syntax

zi wait lucid for \
  depth'1' sbin'bin/*' \
    z-shell/nb

Zi package

zi pack for nb

The 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 $PATH by default; shims are also a bin-gem-node annex feature).

Variables

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 nb to your plugin list.

git clone https://github.com/z-shell/nb.git \
  ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/nb

Add the following to your .zshrc file in the same place you're doing your other zgen load calls in.

zgen load z-shell/nb

About

Feature-rich, next level notebook by xwmx/nb

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages