Add colored cat via pygmentize

This commit is contained in:
Markus Koch 2020-10-25 07:57:10 +01:00
parent 17dee6721a
commit 0dc788d792
1 changed files with 10 additions and 1 deletions

11
_bashrc
View File

@ -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
}