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

Re: 'man' completion

On Aug 27, 10:14am, Bruce Stephens wrote:
} Subject: Re: 'man' completion
} Gossamer <gossamer@xxxxxxxxxxxxxx> writes:
} > I have a nifty set of completion macros for man pages but unfortunately
} > they stop me from getting the filename completion when I'm specifying the
} > file directly
} Ah.  I think if you stick a -f right after the compctl, then that'll
} give you filename completion too.

Yes, that's right, but it might be preferable to use -g with the same
pattern that's in the R[] expression:

	compctl -/ -g '*.([1-9nlo]|[1-9](|[a-z]))' ...

Also, I don't know what the "match-man" function does, but if it's nothing
more than a search of $MANPATH as Gossamer's comment suggested, then it
can be replaced with

	-g "${(@)^${(s(:))MANPATH}}/*/*.([1-9nlo]|[1-9](|[a-z]))(:t:r)"

The only missing bit being that if you want to use the section number to
restrict the search (i.e. "man 5 x<TAB>" completes only to "xferlog" and
not to "xterm" etc.), then you need a function.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

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