Make cat alias use regular cat if output not term

main
Marko Korhonen 4 years ago
parent 93a096540b
commit 8f81558f9d

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

Loading…
Cancel
Save