Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I add in the regular expressions for an additional syntax language?

share|improve this question
Be more specific, what text editor are you talking about? Gedit? – enzotib Aug 2 '11 at 12:43
You should tell us, which editor you use; gedit, mcedit, scite? And if you tell us the language, maybe we know, where to get a syntax file. – user unknown Aug 2 '11 at 12:46
The language is actually a highlighting scheme for a text file. We invented it so it does not exist anywhere. The editor is the default editor that comes with Ubuntu. It just says Text Editor, but in Help About it says gedit. – George Bailey Aug 2 '11 at 13:56
up vote 13 down vote accepted

Gedit (the default text editor) using GTKSourceView for it's syntax highlighting. It uses XML files to define how to highlight different syntax.

There is a tutorial and a reference document on the GTKSourceView site. Finished source file definitions are stored in /usr/share/gtksourceview-2.0/language-specs/, you might want to check them out to learn by example.

There is also a less in depth tutorial on the Gedit site.

share|improve this answer
Editors running in up-to-date versions of Ubuntu will probably be using gtksourcceview-3.0 .. so look for a directory with 3.0, not 2.0 as in the answer above. – Eyal Aug 9 '14 at 15:53

I assume you are talking about gedit (labeled as "text editor" in the ubuntu menu).

Gedit is using GtkSourceView for syntax highlighting. You have to create a language definition for GtkSourceView.

Here is a tutorial:

share|improve this answer
"This page does not exist yet. You can create a new empty page, or use one of the page templates." – Damian Yerrick Jul 12 at 18:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.