Skip to content

Instantly share code, notes, and snippets.

@smileart
Created January 9, 2014 15:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save smileart/8336208 to your computer and use it in GitHub Desktop.
Save smileart/8336208 to your computer and use it in GitHub Desktop.
Improved cat alias with automatic pygments syntax highlight
# Install http://pygments.org/download/ to use this improved cat!
cat() {
if command -v pygmentize > /dev/null; then
pygmentize $1 > /dev/null 2>&1
if [ $? -eq 0 ]; then
pygmentize $1
else
command cat $1
fi
else
command cat $1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment