From 38bab29776950ac2364ed64195b89887717c33de Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Thu, 1 Jan 1970 03:00:00 +0300 Subject: chore: init --- profile/.profile.d/50_pager.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 profile/.profile.d/50_pager.sh (limited to 'profile/.profile.d/50_pager.sh') diff --git a/profile/.profile.d/50_pager.sh b/profile/.profile.d/50_pager.sh new file mode 100644 index 0000000..4270919 --- /dev/null +++ b/profile/.profile.d/50_pager.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +_pagers=" +bat +less +more +cat +" + +for _pager in ${_pagers}; do + # shellcheck disable=SC2139 + if command -v "${_pager}" >/dev/null 2>&1; then + export PAGER="${_pager}" MANPAGER="${_pager}" + + alias p="${PAGER}" + if ! command -v pa >/dev/null 2>&1; then + alias pa="${PAGER}" + fi + + break + fi +done + +unset _pager _pagers -- cgit 1.4.1