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

324 questions
314
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?
190
votes
18 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…
176
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,457
70
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,619
55
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
  • 763
37
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
36
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…
34
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?
25
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,131
24
votes
5 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
  • 574
23
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…
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…
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
  • 15,036
20
votes
3 answers

Different language syntax highlighting within same file

I'm trying to get simple syntax highlighting working within a file. Here's the setup. I have an index.php file, which Notepad++ correctly highlights any PHP code between the tags. Inside of this file, I have some Javascript, which is…
dmackerman
  • 437
  • 2
  • 5
  • 11
20
votes
4 answers

Vim highlighting for specific file types (where to put syntax files, vim events, line to put into vimrc)

I have defined a file time jak.vim to offer custom highlighting when I take notes, however it is being applied to some files that do not have the .jak extension. Specifically a file named progress.jlog. Just to test if the problem was specific to…
1
2 3
21 22