]> arthur.barton.de Git - ax-zsh.git/commitdiff
New "bat" plugin
authorAlexander Barton <alex@barton.de>
Sun, 1 May 2022 13:51:41 +0000 (15:51 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 1 May 2022 13:51:41 +0000 (15:51 +0200)
plugins/bat/README.md [new file with mode: 0644]
plugins/bat/bat.zshrc [new file with mode: 0644]

diff --git a/plugins/bat/README.md b/plugins/bat/README.md
new file mode 100644 (file)
index 0000000..7a6e2c9
--- /dev/null
@@ -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 (file)
index 0000000..9432e2d
--- /dev/null
@@ -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