MANPATH environment variable replaces rather than extends man's built-in search path. Today, I rediscovered a clever little setup on a machine at work.
- Copy /etc/man.config to somewhere in your home dir. Mine seems to be at ~/.config/man/man.config for optimal redundant redundancy. (I will say that keeping the "man.config" name of the file makes vim highlight it without additional fuss.)
- Add your desired
MANPATHlines to this file at whatever position you wish. Don't forget to curse the lack of an include mechanism at this point, which prevents you from automatically getting changes to /etc/man.config. Cheer up, because there probably won't be any.
- Add an alias to your shell. For bash, you would put something like
alias man='man -C ~/.config/man/man.config'(which obviously includes the name of the file chosen in step 1) into
~/.bashrc. Remember to
source ~/.bashrcto make it take effect in the current session.
man, your personal manpages will be searched as well.
The documentation for
man on the system in question claims that it will use $PATH to guess at additional man page locations, but this does not actually work for me. Having a command in
~/.install/bin does not allow
man to find the manpage in