So, I've set up Vim as my default man viewer. I also have NERDTree starting up automatically - but I could really do without NERDTree showing the location the man pages every time I check man.
I've tried setting up the following in my .vimrc:
if (match(expand("%:p:h"),???) == -1) " load NERDTree here endif
But I'm not really sure what to match the path against. $MANPATH would be the obvious choice, however
echo $MANPATH doesn't print anything out in terminal. Running
manpath does produce
/usr/local/man:/usr/local/share/man:/usr/share/man, but I have no idea how to include that in my vimrc. Of course I could just paste the paths as a string, but that would be cheating.
Basically, what I'm looking for is either:
- a way to set the $MANPATH variable so that it points to the folders listed by
- any other way to get the paths in Vim
EDIT: A post-acceptance note in case anyone wants to try that script -
match needs to be replaced with