From d91d6b3534319e4edb16c0a1cc2f5263c6420299 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 2 Mar 2021 20:02:30 +0000 Subject: [PATCH] Wrap bat with additional arguments --- utilities/utilities.plugin.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/utilities/utilities.plugin.zsh b/utilities/utilities.plugin.zsh index e6fd8c7..946c3da 100644 --- a/utilities/utilities.plugin.zsh +++ b/utilities/utilities.plugin.zsh @@ -25,6 +25,16 @@ extract() { fi } +if which bat &> /dev/null; then + # Wrap bat to specify a theme, always enable color, pipe the output to less. + # Both --theme and --color can be specified multiple times and will override + # these defaults. + bat() { + command bat --theme='Solarized (dark)' --color always \ + --paging always --pager 'less -R' "$@" + } +fi + if which docker-machine &> /dev/null; then # Wrap the docker command to print a message if a docker-machine is not # running, rather than just stating it can not find it's socket.