Syntax highlighting, Gedit

Avi Greenbury lists at avi.co
Sun Feb 17 14:08:41 UTC 2013


Johnny Rosenberg wrote:
> Is this possible at all, or do I need to define them all one by one?
> Which I already did, but the filer would be easier to search in the
> less lines it contains.

It's certainly possible to define your own languages, and I suspect
you're most of the way there, but for not know what sort of regular
expressions it expects. 

Gedit uses gtksourceview to work out what colours to use for which
characters, and the documentation on creating a new language
definition for it is here:

  http://developer.gnome.org/gtksourceview/stable/lang-tutorial.html

I don't suggest you go so far as to create your own subset of the C
definition, but that should at least tell you which elements need to
be added and where. I should also, perhaps, warn you that I've never
done this either, so I can't offer any real help directly.

> 
> Also, this is a global file. Can I add my own additions to a local
> file instead? If so, where do I have to put it and what name should it
> have and what should it look like…? Many questions… :P

I wouldn't have thought there was a way to have your own, personal,
syntax highlighting definitions, just because it sounds niche enough
that I wouldn't expect anyone to have implemented it :)

-- 
Avi




More information about the ubuntu-users mailing list