summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2023-12-11 03:04:51 +0100
committerache <ache@ache.one>2023-12-11 03:04:51 +0100
commite771c9f926238813b52a1a4c1c394b4a56776ca8 (patch)
tree0f4f840b47652db0807e91ade596e87a56a08b99
parentAdd a function to get TTFB (diff)
Improve cat to call bat when printed on a terminal
-rw-r--r--functions/cat.fish8
1 files changed, 8 insertions, 0 deletions
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