# Syntax Highlighting for Gedit

**URL:** <https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538>\
**Category:** Request Feedback\
**Created:** [April 13, 2020, 9:30pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538 "2020-04-13T21:30:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon4252683](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@anon4252683](https://discourse.elm-lang.org/u/anon4252683)\
**Post date:** [April 13, 2020, 9:30pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/1 "2020-04-13T21:30:19Z")

</div>

Hi Elm Community! I’m a new user (and potential community member!) and I’m interested in finding a syntax highlighter for gedit, which is the default for any flavor of Ubuntu. I use vim every once in a while, but this would be my second preference. I’m well aware of the Sublime Text editor, and I’m not looking to install a new editor. Does anyone know of an editor, or is familiar enough with elm syntax highlighting that they could contribute? Thanks!

---

<div class="post-metadata">

**Author:** ![anon4252683](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@anon4252683](https://discourse.elm-lang.org/u/anon4252683)\
**Post date:** [April 13, 2020, 11:33pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/2 "2020-04-13T23:33:40Z")

</div>

I found the vim editor file on GitHub, so I’m going to take a shot at using the rules to translate into one for gedit. If I’m successful, I’d be happy to share on here with the larger community (I absolutely can’t move forward with any programming without the pretty colors, lol!)

---

<div class="post-metadata">

**Author:** ![datiswous](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@datiswous](https://discourse.elm-lang.org/u/datiswous)\
**Post date:** [April 14, 2020, 10:31am UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/3 "2020-04-14T10:31:46Z")

</div>

I think you have to make a syntax highlighting definition file for [GtkSourceView](https://wiki.gnome.org/Projects/GtkSourceView) (Gedit uses GtkSourceView).

[Notepadqq](https://notepadqq.com) has syntax highlighting for Elm. it’s a Notepad++ -like editor for the Linux desktop.

---

<div class="post-metadata">

**Author:** ![brian](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/brian/32/2180_2.png) [@brian](https://discourse.elm-lang.org/u/brian)\
**Post date:** [April 14, 2020, 10:44am UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/4 "2020-04-14T10:44:29Z")

</div>

Does Gedit have Haskell syntax highlighting? The syntax is close enough that you may be able to change a few keywords and get a satisfactory result (e.g. you’d have to change `data` to `type`, remove `newtype` and typeclasses, stuff like that.)

---

<div class="post-metadata">

**Author:** ![allanderek](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/allanderek/32/1360_2.png) [@allanderek](https://discourse.elm-lang.org/u/allanderek)\
**Post date:** [April 14, 2020, 11:47am UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/5 "2020-04-14T11:47:01Z")

</div>

I don’t know if the one in micro is any use: [https://github.com/zyedidia/micro/blob/master/runtime/syntax/elm.yaml](https://github.com/zyedidia/micro/blob/master/runtime/syntax/elm.yaml)

---

<div class="post-metadata">

**Author:** ![anon4252683](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@anon4252683](https://discourse.elm-lang.org/u/anon4252683)\
**Post date:** [April 14, 2020, 10:39pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/6 "2020-04-14T22:39:31Z")

</div>

@brian that worked beautifully!

`<anonymized>`

I made the quick changes that you mentioned, but could we talk about some of the “typeclasses and stuff like that?” I’m not familiar so I can’t interpret what that means. If it’s easier, you can also PR to update the file, which is based on haskell, see `<anonymized>`

Thanks for all the speedy responses! This derivative might not be perfect, but it provides enough color so it’s fun to work on and I’m happy. I’ll wait to share the repo more broadly until I’ve gotten feedback from folks here about additional changes that are needed.

---

<div class="post-metadata">

**Author:** ![brian](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/brian/32/2180_2.png) [@brian](https://discourse.elm-lang.org/u/brian)\
**Post date:** [April 15, 2020, 1:05pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/7 "2020-04-15T13:05:01Z")

</div>

I’ve opened a PR with some small fixes. Hope they’re helpful 🙂

---

<div class="post-metadata">

**Author:** ![dmy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dmy/32/702_2.png) [@dmy](https://discourse.elm-lang.org/u/dmy)\
**Post date:** [April 15, 2020, 2:17pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/8 "2020-04-15T14:17:34Z")

</div>

Oops sorry, I made a conflicting PR fixing only the keyword list using:

> <https://github.com/elm/compiler/blob/master/compiler/src/Parse/Keyword.hs#L4>

Once everything is clean, a PR could be made to gtksourceview repo:

> **[data/language-specs · master · GNOME / gtksourceview](https://gitlab.gnome.org/GNOME/gtksourceview/-/tree/master/data/language-specs)**
>
> Welcome to GNOME’s integrated development platform, powered by GitLab

An issue requesting that has been made a few months ago by the way:

> **[\[Elm\] Add Elm language support. (#92) · Issues · GNOME / gtksourceview](https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/92)**
>
> Would it be possible to add syntax highlighting for Elm source files (.elm)? Example screenshot from VsCode:

---

<div class="post-metadata">

**Author:** ![anon4252683](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@anon4252683](https://discourse.elm-lang.org/u/anon4252683)\
**Post date:** [April 15, 2020, 6:34pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/9 "2020-04-15T18:34:24Z")

</div>

@dmy we’ve merged the first, but your PR is also needed! If you want to rebase with master we can get those changes in. Thanks to you both!

---

<div class="post-metadata">

**Author:** ![dmy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dmy/32/702_2.png) [@dmy](https://discourse.elm-lang.org/u/dmy)\
**Post date:** [April 15, 2020, 6:50pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/10 "2020-04-15T18:50:58Z")

</div>

Sure. I rebased it on top of master.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [April 25, 2020, 6:50pm UTC](https://discourse.elm-lang.org/t/syntax-highlighting-for-gedit/5538/11 "2020-04-25T18:50:59Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
