Highlighting languages
The purpose of a syntax highlighting language or syntax definition
language is to detect elements such keywords, variables, strings, and
comments when editing source code. The actual method how to detect these
elements differs among editors so no several
syntax definition languages exist. Their expressivity differs from simple
heuristics to full parsing rules with additional features. In most cases the
detection rules consist of a set of regular expressions.
This page gives a summary of all relevant highlighting languages I could find. Coloring schemes that map these elements to specific text layout are not included.
MARC/PICA highlighting available
vim
The vim editor allows to define syntax definitions in its own config file format.
CodeMirror
The CodeMirror editor library and its syntax definitions are written in JavaScript.
MARC/PICA highlighting not available (yet)
Textmate
The Textmate syntax definition language
is based on property list format which is serialized in XML. It’s file extension
is .tmLanguage
. Textmate syntax definitions can also be used in other editors
and applications such as Visual Studio Code, IntelliJ, and Github.
Sublime 3
The Sublime editor supports Textmate syntax definitions and its own syntax definition language based on YAML.
Pygments
Syntax definitions for the the Python syntax highligther library are written in Python. The command line tool pygmentize can be used to colorize files with Pygments.
Rouge
The Ruby syntax highlighting library is compatible with Pygments but syntax definitions are written in Ruby.
Ace
Syntax definitons for the Ace editor are written as “modes” in JavaScript.
Atom
Syntax definitons for the the Atom editor can be provided as JavaScript packages that either include a Textmate syntax definitions serialized in JSON or implement a TreeSitter grammar in JavaScript.
emacs
The emacs editor allows to define syntax definitions in its own config file format (emacs lisp)
Kate
The Kate syntax highlighting engine uses an XML based format for syntax definition. The highlighting engine has also been ported to Haskell for the Pandoc document converter.
prettify
The prettify highlighting library and its syntax definitions are written in JavaScript.
highlight.js
The prettify highlighting library and its syntax definitions are written in JavaScript.
Eclipse
The Eclipse editor can be extended in Java for syntax definitions but plugins exist to reuse syntax definitons from other editors.
jedit
Syntax definitions for jedit are written in an XML based language.
UltraEdit
UltraEdit uses a custom file format for syntax definitions.
Notepad++
Syntax definitions for Notepad++ can be defined via its user interface and exchanged in an XML based format.
gedit
gedit uses an XML based format for syntax definitions.
Monaco
Monaco editor allows to specify syntax definitions in a JavaScript library called Monarch.
Komodo Edit
Syntax definitions for Komodo Edit must be specified in Python.
NetBeans
Syntax definitions for NetBeans can be specified in Java with a Lexer, which might be created automatically from a grammar file.
BBEdit
BBEdit can be extended by custom syntax definitions based on property list format serialized in XML.
Rainbow
Rainbow is a very simple highlighting library written in Javascript. Custom syntax definitions are defined in JavaScript by pairs of regular expressions and matching element names.
Prism.js
Yet another syntax highlighter in JavaScript.
micro
The micro editor uses a custom YAML based format to defined syntax rules.
GNU Source-highlight
A syntax highlighting library and command line client implemented in C++.
highlight
A source code formatted text converter for the command line.
bat
A clone of the cat
command line tool with syntax highlighting. It uses the
syntect highlighting library that can read Sublime syntax files.