Is it possible to get syntax highlighting for .gitignore
files when using cat
?
Update:
Tried sudo apt-get install python-pygments
as suggested by @rovo but when using comments in the .gitignore
it stops working.
Sample .gitignore
(does not work):
# JetBrains IDEs
.idea
Sample .gitignore
(works):
.idea
Use
pygmentize
, e. g. by defining aliases likedog
orpig
!Add this lines to
~/.bash_aliases
(or perhaps~/.bashrc
):Afterwards restart your terminal or run
source ~/.bashrc
.You might need to install
python-pygments
package:Then you can run
dog .gitgnore
orpig .gitgnore