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

Re: zsh-5.2-test-3



On 12/12/2016 12:37 AM, Daniel Shahaf wrote:
Two optiosn:

1) Use regular expressions.  Assuming your $PAGER is 'less':

     man zshall
     /^ *test <Enter>
     [that's slash, caret, space, asterisk, etc — type it exactly so]

will find instance of 'test' on beginning of line, only.  Then `n'
to go to the next match.

Bloody marvelous, I had no idea we were allowed to use those tricks inside man. But as above still has a few bad hits, whereas:

/^ (seven spaces) test <Enter>

... has only one bad hit, but what an improvement. So I take it that 'run-help' can't magically whisk us down to the command itself? I had supposed that there could be some functionality built into man that might make that possible (hidden tags or something), but if it's just text as seen then of course that won't be happening. I wonder if some wiz could find a way? I know that the rules for man are now written in stone, but if in, say, zshbuiltins all the command headings looked like:

       ~test  [ arg ...

... or something, then you could always search for " ~test " thus eliminating any plain text uses of the word.

I'll experiment with your other ideas a bit later. Thanks Daniel. You know, the above is one of those little things that no adept would bother to mention because it so obvious once you know it, but when you don't know it, life is that much nastier.

BTW, why would run-help alias to man by default? We already have man, so who need another way of running it? Wouldn't the changes Bart mentioned be the natural default for a zsh specific command? I'd sure have appreciated it.



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