When I do man zshbuiltins
I typically want to search for a command.
Suppose I'm looking for info on the alias
command. I get a chunk of text like:
: [ arg ... ]
This command does nothing, although normal argument expansions
is performed which may have effects on shell parameters. A zero
exit status is returned.
alias [ {+|-}gmrsL ] [ name[=value] ... ]
For each name with a corresponding value, define an alias with
that value. A trailing space in value causes the next word to
be checked for alias expansion. If the -g flag is present,
define a global alias; global aliases are expanded even if they
do not occur in command position.
and I want to be able to jump right to the alias
section of this horrible monolithic manpage.
I'm trying to search specifically for the case where it is the very first word on the line. However, all of the following expressions say "Pattern not found":
^alias
^\W*alias
^\s*alias
^[\W\s]*alias
How can I match alias
if and only if it is the first word on the line? Or is there a better way to jump straight to a command? I think my default pager is Less (how can I check this?). Also I'm using Zsh in case that wasn't obvious.
^[^[:alpha:]]+alias
works just fine