Use syntax highlighting for cat .gitignore [duplicate]





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1
















This question already has an answer here:




  • Can `cat` show files using code markup in colors?

    8 answers




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









share|improve this question















marked as duplicate by RoVo, karel, Eric Carvalho, Charles Green, tomodachi Apr 5 at 14:36


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • What you mean by color coding ? syntax highlighting?

    – RoVo
    Apr 5 at 13:22











  • yes, updated the question

    – Alexander Zeitler
    Apr 5 at 13:24











  • github.com/rkitover/vimpager

    – Ravexina
    Apr 5 at 13:32




















1
















This question already has an answer here:




  • Can `cat` show files using code markup in colors?

    8 answers




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









share|improve this question















marked as duplicate by RoVo, karel, Eric Carvalho, Charles Green, tomodachi Apr 5 at 14:36


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • What you mean by color coding ? syntax highlighting?

    – RoVo
    Apr 5 at 13:22











  • yes, updated the question

    – Alexander Zeitler
    Apr 5 at 13:24











  • github.com/rkitover/vimpager

    – Ravexina
    Apr 5 at 13:32
















1












1








1









This question already has an answer here:




  • Can `cat` show files using code markup in colors?

    8 answers




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









share|improve this question

















This question already has an answer here:




  • Can `cat` show files using code markup in colors?

    8 answers




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




This question already has an answer here:




  • Can `cat` show files using code markup in colors?

    8 answers








git cat






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 6 at 19:17







Alexander Zeitler

















asked Apr 5 at 13:16









Alexander ZeitlerAlexander Zeitler

3512725




3512725




marked as duplicate by RoVo, karel, Eric Carvalho, Charles Green, tomodachi Apr 5 at 14:36


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by RoVo, karel, Eric Carvalho, Charles Green, tomodachi Apr 5 at 14:36


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • What you mean by color coding ? syntax highlighting?

    – RoVo
    Apr 5 at 13:22











  • yes, updated the question

    – Alexander Zeitler
    Apr 5 at 13:24











  • github.com/rkitover/vimpager

    – Ravexina
    Apr 5 at 13:32





















  • What you mean by color coding ? syntax highlighting?

    – RoVo
    Apr 5 at 13:22











  • yes, updated the question

    – Alexander Zeitler
    Apr 5 at 13:24











  • github.com/rkitover/vimpager

    – Ravexina
    Apr 5 at 13:32



















What you mean by color coding ? syntax highlighting?

– RoVo
Apr 5 at 13:22





What you mean by color coding ? syntax highlighting?

– RoVo
Apr 5 at 13:22













yes, updated the question

– Alexander Zeitler
Apr 5 at 13:24





yes, updated the question

– Alexander Zeitler
Apr 5 at 13:24













github.com/rkitover/vimpager

– Ravexina
Apr 5 at 13:32







github.com/rkitover/vimpager

– Ravexina
Apr 5 at 13:32












1 Answer
1






active

oldest

votes


















2














Use pygmentize, e. g. by defining aliases like dog or pig!



Add this lines to ~/.bash_aliases (or perhaps ~/.bashrc):



alias dog='pygmentize -g'
alias pig='pygmentize -g -O style=colorful,linenos=1'


Afterwards restart your terminal or run source ~/.bashrc.



You might need to install python-pygments package:



sudo apt-get install python-pygments


Then you can run dog .gitgnore or pig .gitgnore




pygmentize - highlights the input file

Pygments is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.







share|improve this answer


























  • It is still black/white - is it possible it doesn't work with zsh?

    – Alexander Zeitler
    Apr 5 at 13:34











  • Doesn't work on bash either ... I suggest you using vimcat: vim.org/scripts/script.php?script_id=4325 or the github link I posted on your question ;)

    – Ravexina
    Apr 5 at 13:36











  • as the name .bashrc says, it's for bash, so yes. Use .zshrc instead

    – RoVo
    Apr 5 at 13:36











  • @Ravexina ?! works well for me ...

    – RoVo
    Apr 5 at 13:36











  • Works well with any file except .gitgnore ... :/ Don't know why!

    – Ravexina
    Apr 5 at 13:37


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Use pygmentize, e. g. by defining aliases like dog or pig!



Add this lines to ~/.bash_aliases (or perhaps ~/.bashrc):



alias dog='pygmentize -g'
alias pig='pygmentize -g -O style=colorful,linenos=1'


Afterwards restart your terminal or run source ~/.bashrc.



You might need to install python-pygments package:



sudo apt-get install python-pygments


Then you can run dog .gitgnore or pig .gitgnore




pygmentize - highlights the input file

Pygments is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.







share|improve this answer


























  • It is still black/white - is it possible it doesn't work with zsh?

    – Alexander Zeitler
    Apr 5 at 13:34











  • Doesn't work on bash either ... I suggest you using vimcat: vim.org/scripts/script.php?script_id=4325 or the github link I posted on your question ;)

    – Ravexina
    Apr 5 at 13:36











  • as the name .bashrc says, it's for bash, so yes. Use .zshrc instead

    – RoVo
    Apr 5 at 13:36











  • @Ravexina ?! works well for me ...

    – RoVo
    Apr 5 at 13:36











  • Works well with any file except .gitgnore ... :/ Don't know why!

    – Ravexina
    Apr 5 at 13:37
















2














Use pygmentize, e. g. by defining aliases like dog or pig!



Add this lines to ~/.bash_aliases (or perhaps ~/.bashrc):



alias dog='pygmentize -g'
alias pig='pygmentize -g -O style=colorful,linenos=1'


Afterwards restart your terminal or run source ~/.bashrc.



You might need to install python-pygments package:



sudo apt-get install python-pygments


Then you can run dog .gitgnore or pig .gitgnore




pygmentize - highlights the input file

Pygments is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.







share|improve this answer


























  • It is still black/white - is it possible it doesn't work with zsh?

    – Alexander Zeitler
    Apr 5 at 13:34











  • Doesn't work on bash either ... I suggest you using vimcat: vim.org/scripts/script.php?script_id=4325 or the github link I posted on your question ;)

    – Ravexina
    Apr 5 at 13:36











  • as the name .bashrc says, it's for bash, so yes. Use .zshrc instead

    – RoVo
    Apr 5 at 13:36











  • @Ravexina ?! works well for me ...

    – RoVo
    Apr 5 at 13:36











  • Works well with any file except .gitgnore ... :/ Don't know why!

    – Ravexina
    Apr 5 at 13:37














2












2








2







Use pygmentize, e. g. by defining aliases like dog or pig!



Add this lines to ~/.bash_aliases (or perhaps ~/.bashrc):



alias dog='pygmentize -g'
alias pig='pygmentize -g -O style=colorful,linenos=1'


Afterwards restart your terminal or run source ~/.bashrc.



You might need to install python-pygments package:



sudo apt-get install python-pygments


Then you can run dog .gitgnore or pig .gitgnore




pygmentize - highlights the input file

Pygments is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.







share|improve this answer















Use pygmentize, e. g. by defining aliases like dog or pig!



Add this lines to ~/.bash_aliases (or perhaps ~/.bashrc):



alias dog='pygmentize -g'
alias pig='pygmentize -g -O style=colorful,linenos=1'


Afterwards restart your terminal or run source ~/.bashrc.



You might need to install python-pygments package:



sudo apt-get install python-pygments


Then you can run dog .gitgnore or pig .gitgnore




pygmentize - highlights the input file

Pygments is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.








share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 6 at 22:41









Murphy

820316




820316










answered Apr 5 at 13:24









RoVoRoVo

8,4641944




8,4641944













  • It is still black/white - is it possible it doesn't work with zsh?

    – Alexander Zeitler
    Apr 5 at 13:34











  • Doesn't work on bash either ... I suggest you using vimcat: vim.org/scripts/script.php?script_id=4325 or the github link I posted on your question ;)

    – Ravexina
    Apr 5 at 13:36











  • as the name .bashrc says, it's for bash, so yes. Use .zshrc instead

    – RoVo
    Apr 5 at 13:36











  • @Ravexina ?! works well for me ...

    – RoVo
    Apr 5 at 13:36











  • Works well with any file except .gitgnore ... :/ Don't know why!

    – Ravexina
    Apr 5 at 13:37



















  • It is still black/white - is it possible it doesn't work with zsh?

    – Alexander Zeitler
    Apr 5 at 13:34











  • Doesn't work on bash either ... I suggest you using vimcat: vim.org/scripts/script.php?script_id=4325 or the github link I posted on your question ;)

    – Ravexina
    Apr 5 at 13:36











  • as the name .bashrc says, it's for bash, so yes. Use .zshrc instead

    – RoVo
    Apr 5 at 13:36











  • @Ravexina ?! works well for me ...

    – RoVo
    Apr 5 at 13:36











  • Works well with any file except .gitgnore ... :/ Don't know why!

    – Ravexina
    Apr 5 at 13:37

















It is still black/white - is it possible it doesn't work with zsh?

– Alexander Zeitler
Apr 5 at 13:34





It is still black/white - is it possible it doesn't work with zsh?

– Alexander Zeitler
Apr 5 at 13:34













Doesn't work on bash either ... I suggest you using vimcat: vim.org/scripts/script.php?script_id=4325 or the github link I posted on your question ;)

– Ravexina
Apr 5 at 13:36





Doesn't work on bash either ... I suggest you using vimcat: vim.org/scripts/script.php?script_id=4325 or the github link I posted on your question ;)

– Ravexina
Apr 5 at 13:36













as the name .bashrc says, it's for bash, so yes. Use .zshrc instead

– RoVo
Apr 5 at 13:36





as the name .bashrc says, it's for bash, so yes. Use .zshrc instead

– RoVo
Apr 5 at 13:36













@Ravexina ?! works well for me ...

– RoVo
Apr 5 at 13:36





@Ravexina ?! works well for me ...

– RoVo
Apr 5 at 13:36













Works well with any file except .gitgnore ... :/ Don't know why!

– Ravexina
Apr 5 at 13:37





Works well with any file except .gitgnore ... :/ Don't know why!

– Ravexina
Apr 5 at 13:37



Popular posts from this blog

數位音樂下載

When can things happen in Etherscan, such as the picture below?

格利澤436b