Syntax Highleighting Gnome Texteditor

Hi, is there a Syntax Highlighting for Gnome Texteditor (Gksourceview).

There is a Ruby file but not a Crystal file.

Sorry for my englisch . (German is better vor me).

It does not appear that there is, though it may be possible to create one by modifying the Ruby version. data/language-specs/ruby.lang · master · GNOME / gtksourceview · GitLab

The next step would be creating an issue on the GtkSourceView gitlab to discuss adding Crystal support. I couldn’t find a way to add an “extension” to GNOME TextEdit for adding new languages.

@hugopl has a language definition for GtkSourceView on:


Thank you - works.

I thought about send this highlighting definition upstream, I even opened an issue I guess… or something… I remember talking with someone from gnome or GtkSourceView about this… anyway, in the end the the syntax was working for me and I did nothing more :stuck_out_tongue:

BTW it still have some minor issues that need to be fixed, but it already works very well and I use it since 2020.

If anyone wants to try to push this syntax highlighting upstream, feel free to use this file.

To have Crystal syntax highlight meanwhile just copy this file to: /usr/share/gtksourceview-4/language-specs/ or /usr/share/gtksourceview-5/language-specs/

To fix bugs in it or help to improve it, read GtkSource – 5: Language Definition v2.0 Tutorial


Consider cc @deiv for contribute to upstream is a good idea?

This editor a bit cool!

I didn’t even know it before today.

1 Like

Not the right Deiv I guess ;)

1 Like