From 9ebc52552ac4866dad8e855cd32af5fc89a2fd56 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 6 Oct 2019 19:29:39 +0200 Subject: [PATCH] [ADD][SHELL] Use lesspipe pager preprocessor This preprocessor is different from bat in that it can display some information about binary files like archives or pdf files. It also does some syntax highlighting like bat. --- shell/.profile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shell/.profile b/shell/.profile index f80a235..02d42ec 100644 --- a/shell/.profile +++ b/shell/.profile @@ -28,6 +28,10 @@ export LESS_TERMCAP_se=$'\E[0m' # reset reverse video export LESS_TERMCAP_us=$'\E[1;32m' # begin underline export LESS_TERMCAP_ue=$'\E[0m' # reset underline +# Use lesspipe as a file preprocessor (unlike bat, can somewhat read pdf) +{ [ -x /usr/bin/lesspipe.sh ] && eval "$(lesspipe.sh)" } || +{ [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" } # Quoting seems necessary + # Use my preferred pager settings for bat export BAT_PAGER="$PAGER $LESS"