Last active
December 5, 2018 16:56
-
-
Save anonymouss/240893e34a20e69c665ec53771659f35 to your computer and use it in GitHub Desktop.
cat with syntax highlight
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# prerequisition: pygments, `sudo pip install pygments` | |
# usage: copy this file to /usr/bin or create symlink in /usr/bin links to this file. | |
# remember add `x` permission. | |
echo "" | |
function mycat() { | |
local style="monokai" | |
pygmentize -P style=$style -P tabsize=4 -f terminal256 -g "$1" | |
echo "" # add blank line | |
} | |
for file in $@; do | |
mycat "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment