if [ -t 0 ] ; then
  export MANPATH=`manpath`

  if [ -x /usr/bin/vim ] ; then
    export VIMRUNTIME=$(vim -e --cmd 'echo $VIMRUNTIME |quit' 2>&1 >/dev/null | sed 's/\r//')
    if [ -f $VIMRUNTIME/plugin/manpager.vim ] ; then
      export MANPAGER="env MAN_PN=1 vim -M +MANPAGER -"
    fi
  fi
fi
