The Computer Oracle

Is there a zsh equivalent to the bash `help` builtin?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 5 Looping

--

Chapters
00:00 Is There A Zsh Equivalent To The Bash `Help` Builtin?
00:28 Accepted Answer Score 16
00:50 Answer 2 Score 3
01:11 Thank you

--

Full question
https://superuser.com/questions/1563825/...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#zsh

#avk47



ACCEPTED ANSWER

Score 16


As indicated in the Stack Overflow question in @DavidPostill's comment, put this into ~/.zshrc:

unalias run-help
autoload run-help
HELPDIR=/usr/share/zsh/"${ZSH_VERSION}"/help
alias help=run-help

If you're on macOS and installed using Homebrew, then you will want to replace the HELPDIR line with this:

HELPDIR=$(command brew --prefix)/share/zsh/help



ANSWER 2

Score 3


I wanted to see what zsh said about : The noop builtin.

Here's a little hack that worked:

man zshbuiltins |& awk '/^ *:/,/^$/'

I am running the command man zshbuiltins and using an awk range-based regex to print the line that begins with : (possibly with preceeding whitespace) and ends with a blank newline.