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 93a096540b
commit 8f81558f9d

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