Hi Luise
Thanks for sharing this!
When you think it's been tested enough, would you like to propose it
for inclusion in upstream gtksourceview?
https://gitlab.gnome.org/GNOME/gtksourceview/-/tree/master/data/language-specs?ref_type=heads
I have a very simple request: can you add the .ily file extension?
Now let's try to get some feedback from other LilyPond users.
As my favorite text editor is GNOME Text Editor, which uses
gtksourceview for syntax highlighting, I'll use it as an example.
First, find which version of gtksourceview your editor is using:
$ ldd /usr/bin/gnome-text-editor | grep gtksource
libgtksourceview-5.so.0 => /lib64/libgtksourceview-5.so.0
(0x00007f722b200000)
Then create the appropriate directory and download the file:
$ mkdir -p ~/.local/share/gtksourceview-5/language-specs/
$ cd ~/.local/share/gtksourceview-5/language-specs/
$ wget
https://raw.githubusercontent.com/schrodinger-s-kitten/lilypond-gtksourceview-syntax/refs/heads/main/lilypond.lang
(or use git instead of wget)
Now you can launch the editor and open a .ly file.
Il giorno lun 6 ott 2025 alle 10:12:02 -03:00:00, Luise Flesch
<[email protected]> ha scritto:
Hi everyone!
I've created a syntax highlight file for GtkSourceView! The text
editors I know that use it are Pluma (the editor I use) and Gedit,
feel free to add to the list. Probably more Gedit forks.
Here's the GitHub link:
https://github.com/schrodinger-s-kitten/lilypond-gtksourceview-syntax
It's a little clumsy because I'd never worked with XML before, but I
sure do love seeing the little numbers and commands and strings being
coloured, especially having worked with ly for 6 years without any
highlighting :) (please don't talk about Frescobaldi. I tried one (1)
wrong colour scheme and now bro refuses to open) feel free to suggest
improvements!
Hope you enjoy :)
Kit