#1704 Syntax highlighting for Gedit

MoOm Sun 20 Nov 2011

I have created a .lang file to add syntax-highlighting for Fantom in Gedit. This file can be downloaded from here. You can see how it looks here.

It can be installed by copying the file to "/usr/share/gtksourceview-2.0/language-specs/" under Linux. I don't know the path for Windows or MacOSX. It should work with Gedit 3 but I haven't tried.

Here is a list of the language features that are highlighted:

  • single-line comments, doc-comments and multiline-comments (nested comments are supported as well)
  • strings, triple-quote strings, DSL
  • keywords and primitive types
  • basic literals (int, float, decimal, uri)
  • facets

There is no special highlighting for string interpolation or for more complex literals (duration, slots...).

It also considers that any word that begins with an uppercase letter is a type name (following the naming convention of Fantom). If this rule does not work for you, it can be disabled by removing the following line:

<context ref="uppercase-types"/>

andy Tue 22 Nov 2011

@MoOm - you cool if we include this in distro (adm/tools) ?

MoOm Wed 23 Nov 2011

Sure, no problem! :)

Login or Signup to reply.