Syntax Highlighting

Syntax highlighting is a feature of some text editors that displays text—especially source code—in different colors and fonts according to the category of terms. This feature eases writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Users can specify the language of the text, such as C, LaTeX, HTML, or the text editor can automatically recognize it based on the syntax files. Some text editors can also export the color markup in a format that is suitable for printing or for importing into word-processing and/or text-formatting software; for instance VIM has the command 'Convert to HTML' that generates an HTML version of its syntax highlighting.

Example

Below is a snippet of C++ code which the editor has automatically highlighted based on the syntax:
  // Allocate all the windows  for( int i=0; i < max; i++ )  {      pWinsi = new Window();  } 
In this example, the editor has recognized the keywords for, int and new. It recognized the variable names i, pWins and max and highlighted them accordingly. The comment before the code is also highlighted in a specific manner to distinguish it from working code. When looking at pages and pages of code, syntax hightlighting greatly improves the readability and context of the text. The reader can automatically ignore large sections of comments or code, depending on what one desires.

See also

  • Syntax highlighting for Mediawiki markup

 

<< PreviousWord BrowserNext >>
whedefit gesgeshi woude henate ethiopia
the magic faraway tree series
god bless fiji
la concorde
for the gambia our homeland
bai
bellbird
battle of dyrrhachium
god bless our homeland ghana
the books of magic
kenny rogers
telly savalas
space jam
ace brigode
anastasia
propellant
orobas
gremory
ose
partition of india
cosh
supercritical water oxidation
mexicali
commentaries on the laws of england
1940 in sports
reagan
history of the united states (1918 1945)
solomon islands
history of the united states (1865 1918)
institut laue langevin
magellanic plover
1643 in science
credit derivative
1727 in science
hood
moise tshombe
1957 in science
1867 in science
1934 in science
1980s in aviation
lambda legal
lari
new york court of appeals
new york supreme court