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

'man' completion

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, eg:

man ./goofey.1

Forget where I got the original manpage macros from, this is  it ...

# man: complete commands, otherwise complete by search of $MANPATH.
# This is placed as an all-encompassing pattern at the end because
# making it the default before the -x doesn't work.  (It becomes
# '-c + (-K 'match-man' -x ...), not (-c + -K 'match-man') -x ...).
# We also complete paths for -M (override manpath), commands for
# -P (pager) and disable for -S (search sections).  After an explicit
# number (which it helps to complete for you), these completion rules
# assume a thorough search is needed and no longer uses the '-c' hashed
# commands, relying entirely on what's really in the manpath.
compctl -x 'S[1][2][3][4][5][6][7][8][9]' -k '(1 2 3 4 5 6 7 8 9)' \
  - 'R[[1-9nlo]|[1-9](|[a-z]),^*]' -K 'match-man' \
  - 's[-M],c[-1,-M]' -g '*(-/)' \
  - 's[-P],c[-1,-P]' -c \
  - 's[-S],s[-1,-S]' -k '( )' \
  - 's[-]' -k '(a d f h k t M P)' \
  - 'p[1,-1]' -c + -K 'match-man' \
  -- man


: Gossamer     gossamer@xxxxxxxxxxxxxx  | Xanadoodler
: http://www.tertius.net.au/~gossamer/  | And proud of it :)
: Non-cooperation with evil is as much a duty as cooperation with good.
: -- Mohandas Gandhi

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