summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-08-12 18:15:16 -0400
committerJune McEnroe <june@causal.agency>2021-08-12 18:15:16 -0400
commit8e3eea73f069cdbbc16da14e48a44d610dd07a07 (patch)
tree42348390bad4f4a92d4cd98c3f717a5ab18ef944
parentMake minute adjustments to causal.agency (diff)
downloadsrc-8e3eea73f069cdbbc16da14e48a44d610dd07a07.tar.gz
src-8e3eea73f069cdbbc16da14e48a44d610dd07a07.zip
Add cat alias using less
Idea is that LESS=FRX makes it the same for short files... But less
on OpenBSD behaves weirdly. I'll see.
-rw-r--r--home/.shrc8
1 files changed, 8 insertions, 0 deletions
diff --git a/home/.shrc b/home/.shrc
index 4b0e6c61..605f864e 100644
--- a/home/.shrc
+++ b/home/.shrc
@@ -18,6 +18,14 @@ alias rand='openssl rand -base64 33'
 alias private='eval "$(gpg -d ~/.private)"'
 type doas >/dev/null && alias sudo=doas
 
+cat() {
+	if [ $# -eq 1 ] && test -t 1; then
+		less "$@"
+	else
+		command cat "$@"
+	fi
+}
+
 man() {
 	test $# -ne 1 && { command man "$@"; return $?; }
 	(IFS=: