# Syntax Highleighting Gnome Texteditor

**URL:** <https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916>\
**Category:** Help & Support\
**Created:** [August 7, 2023, 2:59pm UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916 "2023-08-07T14:59:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://forum.crystal-lang.org/u/Joerg)\
**Post date:** [August 7, 2023, 2:59pm UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916/1 "2023-08-07T14:59:02Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![nobodywasishere](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/nobodywasishere/32/1983_2.png) [@nobodywasishere](https://forum.crystal-lang.org/u/nobodywasishere)\
**Post date:** [August 7, 2023, 3:21pm UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916/2 "2023-08-07T15:21:49Z")

</div>

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](https://gitlab.gnome.org/GNOME/gtksourceview/-/blob/master/data/language-specs/ruby.lang)

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.

---

<div class="post-metadata">

**Author:** ![GeopJr](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/geopjr/32/1051_2.png) [@GeopJr](https://forum.crystal-lang.org/u/GeopJr)\
**Post date:** [August 8, 2023, 6:18am UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916/3 "2023-08-08T06:18:46Z")

</div>

@hugopl has a language definition for GtkSourceView on:

> <https://github.com/hugopl/tijolo/blob/main/data/language-specs/crystal.lang>

---

<div class="post-metadata">

**Author:** ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://forum.crystal-lang.org/u/Joerg)\
**Post date:** [August 8, 2023, 1:39pm UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916/4 "2023-08-08T13:39:59Z")

</div>

Thank you - works.

---

<div class="post-metadata">

**Author:** ![hugopl](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/hugopl/32/970_2.png) [@hugopl](https://forum.crystal-lang.org/u/hugopl)\
**Post date:** [August 9, 2023, 3:53pm UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916/5 "2023-08-09T15:53:44Z")

</div>

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 😛

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](https://gnome.pages.gitlab.gnome.org/gtksourceview/gtksourceview5/lang-tutorial.html)

---

<div class="post-metadata">

**Author:** ![zw963](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/zw963/32/1623_2.png) [@zw963](https://forum.crystal-lang.org/u/zw963)\
**Post date:** [August 17, 2023, 9:42am UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916/6 "2023-08-17T09:42:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zw963](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/zw963/32/1623_2.png) [@zw963](https://forum.crystal-lang.org/u/zw963)\
**Post date:** [August 17, 2023, 9:55am UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916/7 "2023-08-17T09:55:47Z")

</div>

This editor a bit cool!

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/crystal_lang/original/2X/3/3e9332fc54f64d3d3f0f6a42df0389ffb198caed.png)

I didn’t even know it before today.

---

<div class="post-metadata">

**Author:** ![deiv](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/deiv/32/2124_2.png) [@deiv](https://forum.crystal-lang.org/u/deiv)\
**Post date:** [August 17, 2023, 11:19am UTC](https://forum.crystal-lang.org/t/syntax-highleighting-gnome-texteditor/5916/8 "2023-08-17T11:19:00Z")

</div>

Not the right Deiv I guess ;)
