Prefer nvim as MANPAGER, if available

This commit is contained in:
ItsDrike 2023-04-24 13:09:26 +02:00
parent 8db46cd6bf
commit 3036faee22
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -55,11 +55,16 @@ export MYPY_CACHE_DIR="$XDG_CACHE_HOME/mypy"
#export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
#export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
# Colorful man pages
# If bat is installed, use it as manpager
# Colorful man pages!
# Use neovim to open man pages
# shellcheck disable=SC2155
if command -v bat > /dev/null; then
if command -v nvim >/dev/null; then
export MANPAGER="nvim +Man!"
# If neovim isn't installed, but bat is, use it as a manpager
# (has color support)
elif command -v bat >/dev/null; then
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# Export color definitions for less (default manpager) otherwise
else
export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')"
export LESS_TERMCAP_md="$(printf '%b' '[1;36m')"