From 54fef04a1fae48391bd0966b5f4d07e4e13b54e7 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sun, 1 May 2022 15:51:41 +0200 Subject: [PATCH] New "bat" plugin --- plugins/bat/README.md | 4 ++++ plugins/bat/bat.zshrc | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 plugins/bat/README.md create mode 100644 plugins/bat/bat.zshrc diff --git a/plugins/bat/README.md b/plugins/bat/README.md new file mode 100644 index 0000000..7a6e2c9 --- /dev/null +++ b/plugins/bat/README.md @@ -0,0 +1,4 @@ +## bat + +Find the bat(1) tool and create an alias to "bat" when installed with an other +name (on Debian, it is installed as "batcat", for example). diff --git a/plugins/bat/bat.zshrc b/plugins/bat/bat.zshrc new file mode 100644 index 0000000..9432e2d --- /dev/null +++ b/plugins/bat/bat.zshrc @@ -0,0 +1,12 @@ +# AX-ZSH: Alex' Modular ZSH Configuration +# trash.zshrc: Setup trash(1) + +# Make sure that "bat(1)" is installed +(( $+commands[bat] )) && return 0 + +if (( $+commands[batcat] )); then + alias bat='batcat' + return 0 +fi + +return 1 -- 2.39.2