Questions tagged [syntax-highlighting]

Syntax highlighting is a feature of text editors that displays text, especially source code, in different colors and fonts according to the category of terms.

Syntax highlighting is a feature of text editors that displays text, especially source code, in different colors and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.

Syntax highlighting is a form of secondary notation, since the highlights are not part of the text meaning, but serve to reinforce it. Some editors also integrate syntax highlighting with other features, such as spell checking or code folding, as aids to editing which are external to the language.

Source: http://en.wikipedia.org/wiki/Syntax_highlighting

315 questions
311
votes
3 answers

Assigning custom extensions to a language's syntax highlighting in Notepad++

In the current version of Notepad++ opening .sql files results in Notepad applying SQL syntax highlighting to it. I'd like Notepad++ to do the same for other extensions as well, is there some setting where I can define this?
Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
176
votes
17 answers

How to syntax highlight via Less

is there a way to syntax highlight a file I see in Less? actually I'm using this command to open an xml file (and sometimes a series of them) less htmleditors/htmleditors_config.xml or less [multiple files] I'd like to stay in Less (to learn that…
Jesper Rønn-Jensen
  • 6,910
  • 7
  • 27
  • 34
173
votes
1 answer

How do I get Notepad++ to associate a file type with a language?

I have associated .wxs files with Notepad++. So far so good. However, it doesn't remember that it should use XML syntax highlighting. How do I associate a file-type with a Language?
fredley
  • 3,417
  • 10
  • 32
  • 43
65
votes
3 answers

Is there any way to get bash to have syntax highlighting like fish?

In the fish shell, the actual command line is syntax highlighted: Is there any way to get this same behavior in bash? There is something just like this but for zsh, not bash. Is it possible that this could be ported to bash? To clarify for those…
Wuffers
  • 19,020
  • 17
  • 95
  • 126
46
votes
3 answers

Pipe to less but keep the highlighting

Is it possible to pipe output (e.g. dmesg) to a command like less (or equivalent) and keep the text highlighting used by the original command? example: on the left dmesg | less on the right dmesg
apoc
  • 673
  • 2
  • 6
  • 12
36
votes
2 answers

creating a simple vim syntax highlighting

i have a simple sort of a database file which consists only of entries in the following format variable=value i want to create a simple vim syntax highlighting for it and set it for specific file extension for instance, variable part could be…
user373230
35
votes
3 answers

Syntax highlighting in Microsoft Office Word

Possible Duplicate: How do I easily highlight the syntax of PHP code in Word? I need to paste some code (ANSI C) in Microsoft Office Word, and I need some form of syntax highlighting (instead of simply changing the font to Lucida Console) Is…
Andreas Grech
  • 4,182
  • 8
  • 30
  • 33
33
votes
10 answers

How do I easily highlight the syntax of PHP code in Word?

How do I easily write and syntax-highlighted PHP code (or any others programming language) in a Word 2009 document?
Christian Studer
  • 464
  • 1
  • 5
  • 11
24
votes
6 answers

Is there any *good* HTML-mode for emacs?

I love emacs, and I want to do my web-programming work in it, but I can't find a way to get it to edit HTML properly. I mean it's seriously awful. It will do HTML fine, but not PHP, javascript, etc. I tried getting html-helper-mode... I downloaded…
Carson Myers
  • 3,061
  • 5
  • 23
  • 23
22
votes
2 answers

Convert HTML to image

Background Batch convert various syntax-highlighted source files (C, SQL, Java, PHP, batch, bash) into high-resolution images (600dpi), suitable for an eBook and printed book. Failed Solutions A number of attempts so far: OpenOffice or LibreOffice…
Dave Jarvis
  • 3,168
  • 5
  • 32
  • 37
22
votes
4 answers

How can I highlight XML on the command line?

How can I highlight XML from stdin (e.g. piped from xmllint --format) to stdout? I know how to get highlighting working in nano and view, but is there something that just outputs to stdout and exits? What I'd link to do is just type something…
Sietse
  • 554
  • 5
  • 16
21
votes
5 answers

Is there any way to change Bitbucket code highlighting

I like the code coloring in Github so that keywords gets highlighted when view source code. But in Bitbucket i see very light color and almost no diff between codes , keywords etc. very bad color coding for all languages Is there any way to chnage…
21
votes
4 answers

How do I enable syntax highlighting for .bash_aliases in vim?

I'm working on reorganizing my .bashrc. I moved my aliases to .bash_aliases (which is sourced by .bashrc, but I can't figure out how to enable syntax highlighting for this file. vim seems unable to figure out what language the file is in. It works…
Matthew
  • 14,496
  • 18
  • 73
  • 119
19
votes
3 answers

Better syntax highlighting for Java in Vim?

I've found Vim to have fantastic syntax highlighting with my preferred color schemes for Ruby and Python, but whenever I need to write Java code, it's like I haven't even turned on highlighting in the first place. As you can see, keywords are…
kunaicode
  • 193
  • 1
  • 1
  • 5
19
votes
4 answers

Where can I find a gallery of Pygments CSS files

I googled every possible combination but I couldn't find a list of syntax files. Is there a list of good ones?
Abdulsattar Mohammed
  • 1,369
  • 4
  • 13
  • 16
1
2 3
20 21