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
commita64c3653d5df5e823fcdd07a540e240283816683 (patch)
tree3d15fa6cc5e1630fe6456561c8439259546b5dcb
parentMake minute adjustments to causal.agency (diff)
downloadsrc-a64c3653d5df5e823fcdd07a540e240283816683.tar.gz
src-a64c3653d5df5e823fcdd07a540e240283816683.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=: