Questions tagged [syntax-highlighting]
90 questions
73
votes
5 answers
less command and syntax highlighting
I need to use the less command with the syntax highlighting of the vim command for python, C, bash and other languages.
How do I apply syntax highlighting colors according to vim colors for less command?
PersianGulf
- 10,728
- 8
- 51
- 78
57
votes
9 answers
Syntax highlighting in the terminal
Lots of programming-oriented editors will colorize source code. Is there a command that will colorize source code for viewing in the terminal?
I could open a file with emacs -nw (which opens in the terminal instead of popping up a new window), but…
alexis
- 5,719
- 3
- 21
- 28
30
votes
3 answers
vim: Force specific syntax via command-line argument
When I want to easily read my PostgreSQL schema, I dump it to stderr and redirect it to vim:
pg_dump -h localhost -U postgres dog_food --schema-only | vim -
This gives:
vim does not have a syntax highlight schema, because it has no filename…
Adam Matan
- 2,543
- 6
- 29
- 31
21
votes
2 answers
How to make vim apply /var/log/messages syntax highlighting to any file called "messages" or "messages-*"?
I love vim's colorization of /var/log/messages, but it only works for that – the absolute filename. It doesn't work for older rotations of messages (e.g. /var/log/messages-20120610) or for messages files I get from other systems. How can I tweak…
rsaw
- 1,006
- 1
- 6
- 13
17
votes
2 answers
How to enable syntax highlighting in ranger preview?
I have seen some screenshots where ranger uses syntax-highlighting in its preview window. So I was wondering how to enable this feature and found out that I need the scope.sh file in the directory
/home/user/.config/ranger/scop.sh,
which will be…
PatrickSteiner
- 581
- 3
- 10
- 20
17
votes
1 answer
Where to get Kate color schemes?
Does anyone know where one could find some good Kate color schemes for syntax highlighting?
The only ones that I found that work fine are zenburn and mdark.
Besides those two, I couldn't find anything else (that works). There were a few other…
tkit
- 2,398
- 4
- 21
- 27
13
votes
2 answers
Bash syntax highlighting of subshells
Considering the large amount of questions which turn out to be related to subshells in Bash ("Why doesn't my variable increment in this piped while read loop?"), I just thought it would be very nice to refer to some editor or service where code…
l0b0
- 50,672
- 41
- 197
- 360
12
votes
1 answer
How do I stop emacs from colouring the text of the file I am editing?
How do I stop emacs from colouring the text of the file I am editing? I want everything just in plain white. I know that I can load themes, but it's not obvious which theme does what. Can I just disable all the colouring so that when I start emacs…
Tola Odejayi
- 515
- 5
- 10
11
votes
1 answer
Is there a Vim syntax file for ANSI-colored output of CLI apps?
I have quite a lot of Perl scripts which print colored output to the terminal, using Term::ANSIColor. This is the same as when a shell script does e.g.
echo -e '\e[1;31mError:\e[0m Your fault.'
Viewing log files of these commands works in less…
Stefan Majewsky
- 658
- 5
- 15
10
votes
2 answers
How to change default syntax-highlighting for header-file in Kate
Often I have to open header-files (with ending .h) in Kate. The default syntax-highlighting with which these files will be opened is always C++. How could this be changed to Fortran so that I don't have to switch manually?
Edit1:
I already added a…
Chrispie
- 3,613
- 2
- 13
- 16
8
votes
3 answers
Change directory for Kate syntax highlighting files
I'm running Standard Debian Wheezy with KDE 4.8.4 and Kate 3.8.4.
The Kate text editor's syntax highlighting files are located in:
/usr/share/kde4/apps/katepart/syntax
If I run
kde4-config --prefix
this gives
/usr
and $KDEDIR is empty.…
Chrispie
- 3,613
- 2
- 13
- 16
7
votes
4 answers
Shell - Customize the color of each line of a log file based on a pattern
I would like to change the way I display a big (~6000 lines) log file using wim, less or whatever, in order to simplify the problem checking.
I'd like to highlight some line of the log based on a patter (i.e. error, warning, info...) and/or hide…
Peppe
- 191
- 1
- 1
- 4
7
votes
2 answers
Diff patch output saved to a file. How to see it syntax-colored?
I have a folder with subfolders that contains text files.
Every now and then I run a script that makes a copy of that folder tree and then creates a new one with fresh info.
After that, having the old version and the new version, I run diff to know…
Tulains Córdova
- 2,926
- 4
- 18
- 26
6
votes
3 answers
cat alternative with syntax highlighting
I am looking for a program like cat but with syntax highlighting. As an example I would like to display the content of one of my Python script highlighted in the terminal without using a pager like we do with cat filename.py.
user412649
6
votes
1 answer
vim: how do I set :match and :2match search results to different colors?
For example, I want something along the lines of:
:match search /
/ guibf=Blue
only that doesn't work.
iDontKnowBetter
- 927
- 1
- 8
- 9