diff options
author | June McEnroe <june@causal.agency> | 2021-08-12 18:15:16 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-08-12 18:15:16 -0400 |
commit | 8e3eea73f069cdbbc16da14e48a44d610dd07a07 (patch) | |
tree | 42348390bad4f4a92d4cd98c3f717a5ab18ef944 | |
parent | Make minute adjustments to causal.agency (diff) | |
download | src-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/.shrc | 8 |
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=: |