From 0dc788d7927371e394ba45a014bf413286c800db Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sun, 25 Oct 2020 07:57:10 +0100 Subject: [PATCH] Add colored cat via pygmentize --- _bashrc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/_bashrc b/_bashrc index f79e0cf..09ed9b8 100644 --- a/_bashrc +++ b/_bashrc @@ -63,5 +63,14 @@ stfu () { alias n='stfu nautilus `pwd`' alias ga="git add .;git diff HEAD;git status" -alias ccat="pygmentize" +# Colored cat +alias ccat="pygmentize" +alias rcat="/usr/bin/cat" +cat () { + if [[ `file "$1"` =~ .*source.* ]]; then + ccat $@; + else + rcat $@; + fi +}