I was setting up my work mac the other day and finally got round to implementing an alias for syntax highlighting the cat bash command. It’s very quick and simple.
Firstly, install pygments. Brew won’t work so you’ll need to run:
(I was required to use sudo for the above command but you ought not yourself. This was due to using a computer provided by work which had restricted write permissions for non root users.)
<!– Also, as Keir pointed out to me in the comments, "If you’ve installed python with homebrew… you can simply do:
pip install Pygments“. In this instance, I hadn’t –>
After that just throw a convenient alias in your .bashrc and you’re away:
alias c='pygmentize -O style=monokai -f console256 -g'