From 31c7f11bd66b7b7f5054af10a7b45de625cfba1c Mon Sep 17 00:00:00 2001 From: Starfall Date: Mon, 29 Aug 2022 12:42:54 -0500 Subject: zsh: use bat as MANPAGER for syntax highlighting --- .config/zsh/.zshenv | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index eee33d7..c5d2066 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -10,3 +10,10 @@ if [[ $INTELLIJ -eq 1 ]]; then fi [[ -f "$HOME/.cargo/env" ]] && . "$HOME/.cargo/env" + +if command -v bat &> /dev/null; then + export MANPAGER="sh -c 'col -bx | bat --plain --language man'" + # note that mandoc needs a wrapper script e.g.: + # col -bx < "$1" | bat -p -l man + # +fi -- cgit