bat is a cat replacement that adds syntax highlighting to file previews.
bat
cat
You can install bat with brew install bat
brew install bat
Next, you simply call bat my_file.md to print out the contents.
bat my_file.md