From 9b55aabb931c0bd2061e6c6b8853a061e3bf28c0 Mon Sep 17 00:00:00 2001 From: velvettear Date: Wed, 2 Oct 2024 11:18:39 +0200 Subject: [PATCH] set pager to 'less' if 'bat' is unavailable --- zsh/zprofile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zsh/zprofile b/zsh/zprofile index 44fb4b8..f0bc81b 100755 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -23,7 +23,11 @@ export TEMP="/tmp" export TMPDIR="/tmp" export EDITOR="nvim" export VISUAL="nvim" -export PAGER="bat" +if [[ "$(command bat 2> /dev/null)" ]]; then + export PAGER="bat" +else + export PAGER="less" +fi # ----- history ----- # export HISTFILE="$HOME/.zhistory"