Use syntax highlighting for cat .gitignore [duplicate]
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
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
git cat
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.
add a comment |
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
git cat
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
add a comment |
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
git cat
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
git cat
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
It is still black/white - is it possible it doesn't work withzsh?
– Alexander Zeitler
Apr 5 at 13:34
Doesn't work onbasheither ... I suggest you usingvimcat: 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.bashrcsays, it's forbash, so yes. Use.zshrcinstead
– 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
|
show 3 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
It is still black/white - is it possible it doesn't work withzsh?
– Alexander Zeitler
Apr 5 at 13:34
Doesn't work onbasheither ... I suggest you usingvimcat: 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.bashrcsays, it's forbash, so yes. Use.zshrcinstead
– 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
|
show 3 more comments
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.
It is still black/white - is it possible it doesn't work withzsh?
– Alexander Zeitler
Apr 5 at 13:34
Doesn't work onbasheither ... I suggest you usingvimcat: 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.bashrcsays, it's forbash, so yes. Use.zshrcinstead
– 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
|
show 3 more comments
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.
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.
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 withzsh?
– Alexander Zeitler
Apr 5 at 13:34
Doesn't work onbasheither ... I suggest you usingvimcat: 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.bashrcsays, it's forbash, so yes. Use.zshrcinstead
– 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
|
show 3 more comments
It is still black/white - is it possible it doesn't work withzsh?
– Alexander Zeitler
Apr 5 at 13:34
Doesn't work onbasheither ... I suggest you usingvimcat: 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.bashrcsays, it's forbash, so yes. Use.zshrcinstead
– 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
|
show 3 more comments
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