[clug] More in the list of things that someone should have told me long ago.

Bryan Kilgallin bryan at netspeed.com.au
Fri Nov 28 04:00:15 MST 2014


G'day Michael:

> Thanks Andrew (but wtf is -g ?)

The original post was a misquote ("ca" instead of "cat").

alias ca="pygmentize -g"

The following page gives the code below, and an image of the colourful results.

https://coderwall.com/p/o6_ong/cat-syntax-highlighting

I use |cat| command everyday, it is very useful to take a quick look to 
a file, but when reading programmatic code, syntax highlighting is welcome.

An easy way to add a real syntax highlighting is to use the |Pygments| 
<http://pygments.org/> python package.

1) Install Pygments package

|$ easy_install Pygments |

2) Create an alias

Add this your |.bashrc| or |.zshrc|

|alias cat="pygmentize -g" |

3) Source your |.rc| file

|$ . .zshrc |

4) Try it!

|$ cat app/autoload.ph |

-- 
www.netspeed.com.au/bryan/



More information about the linux mailing list