Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Better Help Docs Searching?



On Sun, Aug 1, 2021 at 12:46 PM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
>
> All of that said, is there any way to easily find keywords / flags in
> either the online docs OR the man pages -- rather than having way too
> many matches for other things that mention the same word (e.g. "read"
> as mentioned above).

There might be better ways but here's how I do it.

I have this in my ~/.zshrc:

    autoload -Uz run-help
    unalias run-help

This allows me to type "read" in an interactive shell and press Alt+h
(aka ESC h) to open the help file for the read builtin.

Sometimes this doesn't work (for example, try it with "bindkey"). In
this case I would run `man zshall` (one page to rule them all) and
search for "    read" -- note a bunch of spaces in front. If this
query has too many hits, I would use "^ {4,}read\b". I use the same
trick when searching for the description of flags in man pages. For
example, to find the description of "-z" in `man rsync`, I would first
search for "    -z" because it's easy to type and then for the more
specific "^ {4,}-z\b" in case I get too many hits.

Roman.




Messages sorted by: Reverse Date, Date, Thread, Author