Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: man compctl
- X-seq: zsh-users 1273
- From: Mirar <mirar@xxxxxxxxx>
- To: Thomas Köhler <jean-luc@xxxxxxxxxxxxxxxxx>
- Subject: Re: man compctl
- Date: 24 Jan 1998 12:37:54 +0100
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: Thomas Köhler's message of "Fri, 23 Jan 1998 22:22:36 +0100"
- References: <E0xucM7-00074S-00@xxxxxxxxxxxxxxxxxx> <82hg6zowz8.fsf@xxxxxxxxxxx> <19980123222236.60814@xxxxxxxxxxxxxxxxx>
> # completion for manpages
I wrote one that demands kind-of fast computers, but i was lazy:
#------------------------------------------------------------------------------
compctl -k "(- -a -d -F -l -r -t -M -T -s -k -f)" \
-K compmanfull \
-x "C[-1,-s^],s[-s]" -K compmansections \
- "R[-f,;]" -f \
- "R[-k,;]" -k "()" \
- "R[-s,;]" -K compmansection \
-- man
compmanfull()
{ reply=(${^manpath}/man*/*(N:t:r)) }
compmansections()
{
reply=( ${^manpath}/man*(N/) )
reply=( ${reply##*/man} )
}
compmansection()
{
local a
read -Ac a
echo $a | sed -ne 's/^.* -s\([^ ]*\).*$/\1/p' | read prefix
reply=(${^manpath}/man$prefix/*(N:t:r))
}
#------------------------------------------------------------------------------
Messages sorted by:
Reverse Date,
Date,
Thread,
Author