Files
gf-core/doc/gf-editor-modes.md
2025-08-02 20:36:03 +02:00

2.7 KiB

Editor modes & IDE integration for GF

We collect GF modes for various editors on this page. Contributions are welcome!

Emacs

gf.el by Johan Bockgård provides syntax highlighting and automatic indentation and lets you run the GF Shell in an emacs buffer. See installation instructions inside.

Atom

language-gf, by John J. Camilleri

Visual Studio Code

  • Grammatical Framework Language Server by Andreas Källberg. This provides syntax highlighting and a client for the Grammatical Framework language server. Follow the installation instructions in the link.
  • Grammatical Framework is a simpler extension without any external dependencies which provides only syntax highlighting.

Eclipse

GF Eclipse Plugin, by John J. Camilleri

Gedit

By John J. Camilleri

Copy the file below to ~/.local/share/gtksourceview-3.0/language-specs/gf.lang (under Ubuntu).

Some helpful notes/links:

  • The code is based heavily on the haskell.lang file which I found in /usr/share/gtksourceview-2.0/language-specs/haskell.lang.
  • Ruslan Osmanov recommends registering your file extension as its own MIME type (see also here), however on my system the .gf extension was already registered as a generic font (application/x-tex-gf) and I didn't want to risk messing any of that up.
  • This is a quick 5-minute job and might require some tweaking. The GtkSourceView language definition tutorial is the place to start looking.
  • Contributions are welcome!

Geany

By John J. Camilleri

Custom filetype config files for syntax highlighting in Geany.

For version 1.36 and above, copy one of the files below to /usr/share/geany/filedefs/filetypes.GF.conf (under Ubuntu). If you're using a version older than 1.36, copy the file to /usr/share/geany/filetypes.GF.conf. You will need to manually create the file.

You will also need to edit the filetype_extensions.conf file and add the following line somewhere:

GF=*.gf

Vim

vim-gf