@justine@snac.smithies.me.uk @obj@bsd.cafe
i use zsh on my OpenBSD boxes:
this is what i came up with:
if command -v bat &> /dev/null; then
zsh-defer eval $(bat --completion zsh)
export BAT_THEME=ansi
alias cat="bat -pp"
alias bat="bat -p"
# colored manpages
function man {
sh -c "man '$@' | col -bx | \bat -pl man"
}
# colored -h and --help
alias -g -- -h='-h 2>&1 | \bat -pl help'
alias -g -- --help='--help 2>&1 | \bat -pl help'
# help command
function help {
sh -c "'$@' --help 2>&1 | \bat -pl help"
}
fi
the if command -v bat bit is nice to have in case bat for whatever reason isn't on your system.