Make cat alias use regular cat if output not term

This commit is contained in:
Marko Korhonen 2020-04-27 12:16:02 +03:00
parent 42ef8a7b90
commit 841e1042b9
No known key found for this signature in database
GPG key ID: 911B85FBC6003FE5

View file

@ -4,8 +4,15 @@ alias gac='ga && gc'
alias gpull='git pull' alias gpull='git pull'
alias gpush='git push' alias gpush='git push'
# Syntax highlighting cat # Syntax highlighting cat if output is a terminal
alias ncat='nvimpager -c' cat() {
# Check if output is a terminal, else use regular cat
if [ -t 1 ]; then
nvimpager -c $@
else
/usr/bin/cat $@
fi
}
rip() { rip() {
abcde abcde