#!/bin/ksh
#
# $Revision: 1.2 $ $Date: 2012-07-18 19:13:16-04 $
# $Source: /home/vogelke/bin/RCS/man,v $
# $Host: sys7.com $
# $UUID: f280e54a-5375-48b9-9d4d-ff522f6d8967 $
#
#<man: replacement for regular man program using vim as pager.

export PATH=/usr/local/bin:/usr/bin:/bin
umask 077
tmp=/tmp/man$$

man ${1+"$@"} | col -b > $tmp
set X $(ls -l $tmp)

case "$6" in
    0|1) ;;      # col -b with no input writes single newline.
    *)   view -S $HOME/lib/man.vim $tmp ;;
esac

rm $tmp
exit 0
