|
| 1 | +# Editor modes & IDE integration for GF |
| 2 | + |
| 3 | +We collect GF modes for various editors on this page. Contributions are welcome! |
| 4 | + |
| 5 | +## Emacs |
| 6 | + |
| 7 | +[gf.el](https://github.com/GrammaticalFramework/gf-emacs-mode) by Johan |
| 8 | +Bockgård provides syntax highlighting and automatic indentation and |
| 9 | +lets you run the GF Shell in an emacs buffer. See installation |
| 10 | +instructions inside. |
| 11 | + |
| 12 | +## Atom |
| 13 | + |
| 14 | +[language-gf](https://atom.io/packages/language-gf), by John J. Camilleri |
| 15 | + |
| 16 | +## Visual Studio Code |
| 17 | + |
| 18 | +* [Grammatical Framework Language Server](https://marketplace.visualstudio.com/items?itemName=anka-213.gf-vscode) by Andreas Källberg. |
| 19 | +This provides syntax highlighting and a client for the Grammatical Framework language server. Follow the installation instructions in the link. |
| 20 | +* [Grammatical Framework](https://marketplace.visualstudio.com/items?itemName=GrammaticalFramework.gf-vscode) is a simpler extension |
| 21 | +without any external dependencies which provides only syntax highlighting. |
| 22 | + |
| 23 | +## Eclipse |
| 24 | + |
| 25 | +[GF Eclipse Plugin](https://github.com/GrammaticalFramework/gf-eclipse-plugin/), by John J. Camilleri |
| 26 | + |
| 27 | +## Gedit |
| 28 | + |
| 29 | +By John J. Camilleri |
| 30 | + |
| 31 | +Copy the file below to |
| 32 | +`~/.local/share/gtksourceview-3.0/language-specs/gf.lang` (under Ubuntu). |
| 33 | + |
| 34 | + * [gf.lang](../src/tools/gf.lang) |
| 35 | + |
| 36 | +Some helpful notes/links: |
| 37 | + |
| 38 | + * The code is based heavily on the `haskell.lang` file which I found in |
| 39 | +`/usr/share/gtksourceview-2.0/language-specs/haskell.lang`. |
| 40 | + * Ruslan Osmanov recommends |
| 41 | +[registering your file extension as its own MIME type](http://osmanov-dev-notes.blogspot.com/2011/04/how-to-add-new-highlight-mode-in-gedit.html) |
| 42 | +(see also [here](https://help.ubuntu.com/community/AddingMimeTypes)), |
| 43 | +however on my system the `.gf` extension was already registered |
| 44 | +as a generic font (`application/x-tex-gf`) and I didn't want to risk |
| 45 | +messing any of that up. |
| 46 | + * This is a quick 5-minute job and might require some tweaking. |
| 47 | +[The GtkSourceView language definition tutorial](http://developer.gnome.org/gtksourceview/stable/lang-tutorial.html) |
| 48 | +is the place to start looking. |
| 49 | + * Contributions are welcome! |
| 50 | + |
| 51 | +## Geany |
| 52 | + |
| 53 | +By John J. Camilleri |
| 54 | + |
| 55 | +[Custom filetype](http://www.geany.org/manual/dev/index.html#custom-filetypes) |
| 56 | +config files for syntax highlighting in [Geany](http://www.geany.org/). |
| 57 | + |
| 58 | +For version 1.36 and above, copy one of the files below to |
| 59 | +`/usr/share/geany/filedefs/filetypes.GF.conf` (under Ubuntu). |
| 60 | +If you're using a version older than 1.36, copy the file to `/usr/share/geany/filetypes.GF.conf`. |
| 61 | +You will need to manually create the file. |
| 62 | + |
| 63 | + * [light-filetypes.GF.conf](../src/tools/light-filetypes.GF.conf) |
| 64 | + * [dark-filetypes.GF.conf](../src/tools/dark-filetypes.GF.conf) |
| 65 | + |
| 66 | +You will also need to edit the `filetype_extensions.conf` file and add the |
| 67 | +following line somewhere: |
| 68 | + |
| 69 | +``` |
| 70 | +GF=*.gf |
| 71 | +``` |
| 72 | + |
| 73 | +## Vim |
| 74 | + |
| 75 | +[vim-gf](https://github.com/gdetrez/vim-gf) |
0 commit comments