gf-3.3: doc/gf-editor-modes.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.sf.net">
<LINK REL="stylesheet" TYPE="text/css" HREF="../css/style.css">
<TITLE>Editor modes & IDE integration for GF</TITLE>
</HEAD><BODY BGCOLOR="white" TEXT="black">
<P ALIGN="center"><CENTER><H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>Editor modes & IDE integration for GF</H1>
<FONT SIZE="4">
</FONT></CENTER>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<UL>
<LI><A HREF="#toc1">GF Eclipse Plugin</A>
<LI><A HREF="#toc2">Emacs</A>
<LI><A HREF="#toc3">Gedit</A>
<LI><A HREF="#toc4">Geany</A>
</UL>
<P></P>
<HR NOSHADE SIZE=1>
<P></P>
<P>
We collect GF modes for various editors on this page. Contributions are
welcome!
</P>
<A NAME="toc1"></A>
<H2>GF Eclipse Plugin</H2>
<P>
As a new development under the MOLTO Poject, there is now a (beta) Eclipse plugin for
writing GF grammars within the Eclipse IDE.
Details can be found <A HREF="../eclipse/">here</A>
</P>
<A NAME="toc2"></A>
<H2>Emacs</H2>
<P>
<A HREF="../src/tools/gf.el">gf.el</A> 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.
</P>
<A NAME="toc3"></A>
<H2>Gedit</H2>
<P>
<A HREF="http://johnjcamilleri.com/">John J. Camilleri</A>
provided the following syntax highlighting mode for
<A HREF="http://www.gedit.org/">Gedit</A> (the default text editor in Ubuntu).
</P>
<P>
Copy the file below to
<CODE>~/.local/share/gtksourceview-2.0/language-specs/gf.lang</CODE> (under Ubuntu).
</P>
<UL>
<LI><A HREF="../src/tools/gf.lang">gf.lang</A>
</UL>
<P>
Some helpful notes/links:
</P>
<UL>
<LI>The code is based heavily on the <CODE>haskell.lang</CODE> file which I found in
<CODE>/usr/share/gtksourceview-2.0/language-specs/haskell.lang</CODE>.
<LI>Ruslan Osmanov recommends
<A HREF="http://osmanov-dev-notes.blogspot.com/2011/04/how-to-add-new-highlight-mode-in-gedit.html">registering your file extension as its own MIME type</A>
(see also <A HREF="https://help.ubuntu.com/community/AddingMimeTypes">here</A>),
however on my system the <CODE>.gf</CODE> extension was already registered
as a generic font (<CODE>application/x-tex-gf</CODE>) and I didn't want to risk
messing any of that up.
<LI>This is a quick 5-minute job and might require some tweaking.
<A HREF="http://developer.gnome.org/gtksourceview/stable/lang-tutorial.html">The GtkSourceView language definition tutorial</A>
is the place to start looking.
<LI>Contributions are welcome!
</UL>
<A NAME="toc4"></A>
<H2>Geany</H2>
<P>
<A HREF="http://johnjcamilleri.com/">John J. Camilleri</A> provided the following
<A HREF="http://www.geany.org/manual/dev/index.html#custom-filetypes">custom filetype</A>
config files for syntax highlighting in <A HREF="http://www.geany.org/">Geany</A>.
</P>
<P>
Copy one of the files below to <CODE>/usr/share/geany/filetypes.GF.conf</CODE>
(under Ubuntu). You will need to manually create the file.
</P>
<UL>
<LI><A HREF="../src/tools/light-filetypes.GF.conf">light-filetypes.GF.conf</A>
<LI><A HREF="../src/tools/dark-filetypes.GF.conf">dark-filetypes.GF.conf</A>
</UL>
<P>
You will also need to edit the <CODE>filetype_extensions.conf</CODE> file and add the
following line somewhere:
</P>
<PRE>
GF=*.gf
</PRE>
<!-- html code generated by txt2tags 2.5 (http://txt2tags.sf.net) -->
<!-- cmdline: txt2tags -thtml ./doc/gf-editor-modes.t2t -->
</BODY></HTML>