ohmyksh/completions/man.org
Raf Czlonka d27c85fbe1 Fix and improve man(1) completion
Fixes several issues in the current `man(1)` completion:

- _section_ numbers are not stripped off
- _Perl Programmers Reference Guide_ (`3p`) section is ignored
- manual page name can only be completed as the 1st argument

While there, add several more manual page hierarchies, i.e. `cat*`
for _graphiz_ on OpenBSD, `/usr/local/share/man` on macOS, etc.
2021-03-31 13:56:03 +01:00

509 B

Completions: man

Leven 1

Completions for man pages are found via:

for i in /usr{,/X11R6,/local}{,/share}/man/{,cat,man}[1-9lnp]{,f,p}
do
	test -d $i && ls $i
done | rev | cut -d. -f2- | rev | sort -u > $MAN_CACHE

Currently the cache is never re-created. Operating without a cache causes significant load times. If one requires the cache to be refreshed they can run the following in .xsession or similar:

rm -f ${LOAD_PATH}/cache/man