Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Making run-help smart?
- X-seq: zsh-workers 43948
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Making run-help smart?
- Date: Fri, 28 Dec 2018 12:19:26 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xPLynb1PC6RXMuRs6O1M6HuLQugpH4HUQ0mkZ13S9UU=; b=M3rDQFG0p1stvKk9Bsqesruz10xjezNBZdflz2PqkcqQUCiBsg5E+r65ZU3aHSKWPy iWI73xVQmYAUxjBO05peb7MnF0/9czaLuwMMOSCFqCaF3MK6zUNxI6+QoAs+tc+Ftq5x uBJk21JrHwsP/aO8Ls0PvxRz6wpAgs2xaBwth204uBukYeswP/1fpY7KFIWRuedgSN1J lxmB8dpjrY45zgoKm+VGl21RbG7h4kYNp1tyDILkUjUDIuqwNrdg4rfn2ephDBNlsUyn xQ/uwIq+aAPu5S/S3oijLzWNY5+dzE6JPaFtHxv3bS7rTMx/zW3bMI7Xg9FaMbk1bVEQ jjeg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I wonder if run-help could be made smart by mimicking what this function does:
zman () {
PAGER="less -g -s '+/^ "$1"'" command man zshall
}
Basically, almost always a **term** that is being documented is placed
with 7-spaces gap from beginning of the line. Try this:
zman declare
to see how it works. It's very often directly successful, sometimes it
just limits the number of search results from e.g. 47 to 3 (like for
`zman typeset'), which is still very useful. It also allows to search
for *flags*, when the letter is appended with a few (4 or more)
spaces, like so:
zman "a "
So, `run-help declare' would be directing the user to declare's
description in manual. Would this be useful?
The `run-help typeset' would point to 3 places, but I think that an
additional logic in run-help could point the user directly to the 3rd
item, the `typeset' manual entry.
The `run-help a' would automatically append 4-5 spaces after the flag
(because it would detect that a single-letter is being queried) and
this way find direct flag entries in the manual.
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author