Discover, install, and configure shell plugins with Fig Plugin Store →
😀

Zman

Use fzf to quickly browse Zsh manuals

mattmc3
|
15 stars
0 forks

zman

License works with prezto works with ohmyzsh

Use fzf to quickly browse Zsh manuals

zman

Description

This plugin scrapes the Zsh documentation for index words and phrases and lets you quickly navigate to the online docs. It uses fzf to provide fuzzy searching. Be sure you have it installed prior to using this plugin.

Why do you need this plugin?

If you have ever tried to find some Zsh documentation from the command line, you know how tricky that can be. First, you probably try man out of habit:

% man zstyle
No manual entry for zstyle

Then, assuming you have run-help set up properly, maybe you try that.

% run-help zstyle
zstyle See the section `The zsh/zutil Module' in zshmodules(1)

Instead of taking you where you want to go, it tells you you need to search yet again, so you do:

% run-help zshmodules
# finally, you're in the docs!
# but, you still have to search once more by typing '/zstyle'

I got tired of all that and decided there's got to be a better way. With this plugin, you simply do the following:

% zman zstyle
# fuzzy finder opens with your initial 'zstyle' query.
# pick one of the options and your browser opens right to the online manual

If you don't want to make a selection, CTRL-c cancels as you would expect.

Installation

Install with a Zsh plugin manager

To install using a Zsh plugin manager, add the following to your .zshrc

  • pz: pz source mattmc3/zman
  • zcomet: zcomet load mattmc3/zman
  • zgenom: zgenom load mattmc3/zman
  • znap: znap source mattmc3/zman

Install manually, without a plugin manager

To install manually, first clone the repo:

git clone https://github.com/mattmc3/zman ${ZDOTDIR:-~}/.zplugins/zman

Then, in your .zshrc, add the following line:

source ${ZDOTDIR:-~}/.zplugins/zman/zman.zsh

Install for Oh-My-Zsh

To install with Oh-My-Zsh, first clone the repo from an interactive Zsh session:

# make sure your $ZSH_CUSTOM is set
ZSH_CUSTOM=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}

# now, clone the plugin
git clone https://github.com/mattmc3/zman $ZSH_CUSTOM/plugins/zman

Then, add the plugin to your Oh-My-Zsh plugins list in your .zshrc

# in your .zshrc, add this plugin to your plugins list
plugins=(... zman)

Install for Prezto

To install with Prezto, first clone the repo from an interactive Zsh session:

# make sure your $ZPREZTODIR is set
ZPREZTODIR=${ZPREZTODIR:-~/.zprezto}
# clone the repo to a prezto contrib dir
git clone https://github.com/mattmc3/zman $ZPREZTODIR/contrib/zman/external
# set up the contrib
echo "source \${0:A:h}/external/zman.plugin.zsh" > $ZPREZTODIR/contrib/zman/init.zsh

Then, add the plugin to your Prezto plugins list in .zpreztorc

zstyle ':prezto:load' pmodule \
  ... \
  zman \
  ...