From e292eb508413b9174684a8e75c93474a7f5351ee Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 23 Aug 2021 23:07:31 -0500 Subject: Initial --- bash/man.bash | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 bash/man.bash (limited to 'bash/man.bash') diff --git a/bash/man.bash b/bash/man.bash new file mode 100644 index 0000000..4927952 --- /dev/null +++ b/bash/man.bash @@ -0,0 +1,9 @@ +export MANWIDTH=80 + +# on smaller terminals, use their width +# (cf. https://wiki.archlinux.org/index.php/Man_page#Page_width) +man() { + local width=$(tput cols) + [ $width -gt $MANWIDTH ] && width=$MANWIDTH + env MANWIDTH=$width man "$@" +} -- cgit 1.4.1-21-gabe81