SC2123 warns that the PATH variable is being manipulated, but this is
exactly the intention here.
SC1091 warns that /etc/profile cannot be checked. This is fine, as this
file is provided by the platform and there is no need to check it here.
shellcheck(1) is warning that the single quotes prevent the expression
from being expanded. However, this is the desired behavior because this
expression is meant to be interpreted by vim(1), not bash(1).
This makes sure the return code of extracting the path from manpath(1)
is not ignored. Also, unset the MANPATH environment variable instead of
just assigning an empty string to it, so that manpath(1) determines a
suitable default hierarchy to search for manual pages.
The way I was doing the test is incorrect, as [ is the test(1) program
and the shell builtin command is not something it understands. Instead,
I now just let the shell execute `command` and then set the variable if
`brew` is available.