Make cat alias use regular cat if output not term
This commit is contained in:
parent
93a096540b
commit
8f81558f9d
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue