-
Notifications
You must be signed in to change notification settings - Fork 1
/
man
38 lines (31 loc) · 923 Bytes
/
man
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
man()
{
WIDTH=80
if (( WIDTH > COLUMNS ))
then
WIDTH=$COLUMNS
fi
LESSOPEN_ORIGINAL=$LESSOPEN
export LESSOPEN="|- lesscenter %s"
MANWIDTH=$WIDTH command man $*
export LESSOPEN=$LESSOPEN_ORIGINAL
unset MANWIDTH
unset LESSOPEN_ORIGINAL
# LESS_TERMCAP_mb = Begins blinking.
# LESS_TERMCAP_md = Begins bold.
# LESS_TERMCAP_me = Ends mode.
# LESS_TERMCAP_se = Ends standout-mode.
# LESS_TERMCAP_so = Begins standout-mode.
# LESS_TERMCAP_ue = Ends underline.
# LESS_TERMCAP_us = Begins underline.
# env \
# LESS_TERMCAP_mb=$(printf "\e[1;31m") \
# LESS_TERMCAP_md=$(printf "\e[1;31m") \
# LESS_TERMCAP_me=$(printf "\e[0m") \
# LESS_TERMCAP_se=$(printf "\e[0m") \
# LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
# LESS_TERMCAP_ue=$(printf "\e[0m") \
# LESS_TERMCAP_us=$(printf "\e[1;32m") \
# man "$@"
}