about summary refs log tree commit diff
path: root/profile/.profile.d/50_pager.sh
blob: 427091923de28e2063fd66e5c3b43d9d9b9a8aae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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

Consider giving Nix/NixOS a try! <3