From e771c9f926238813b52a1a4c1c394b4a56776ca8 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 11 Dec 2023 03:04:51 +0100 Subject: Improve cat to call bat when printed on a terminal --- functions/cat.fish | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 functions/cat.fish diff --git a/functions/cat.fish b/functions/cat.fish new file mode 100644 index 0000000..f58224e --- /dev/null +++ b/functions/cat.fish @@ -0,0 +1,8 @@ +function cat -d "Print a file nicely" + if isatty stdout + bat $argv + else + set -l catBin $(type --no-functions --path cat) + $catBin $argv + end +end -- cgit v1.2.3