Wednesday, July 30, 2008

Setting up gedit for groovy and grails

Setting up gedit for groovy and grails

 I use CentOS5 and Ubuntu 8.04.

Save groovy-mime.xml to your home directory.

Save groovy.lang to your home directory.

Save gsp-mime.xml to your home directory.

Save gsp.lang to your home directory.

The above 4 files are not under any restrictive license. They are for anyone who may want them for any use they may wish to put them to.

Log-in as root or you can also log-in as a non-root user with sudo permissions.

If you do login as a non-root user then you should make the appropriate changes to the commands below i.e. by adding sudo before each of the commands. Open a command line terminal and do:
mv ~/groovy-mime.xml /usr/share/mime/packages/
mv ~/groovy.lang /usr/share/gtksourceview-2.0/language-specs/
mv ~/gsp-mime.xml /usr/share/mime/packages/  

mv ~/gsp.lang /usr/share/gtksourceview-2.0/language-specs/
update-mime-database /usr/share/mime

Launch gedit and open a groovy file or a gsp file. You should now have syntax highlighting.


  1. Hi,

    Thanks for your post ! It worked great. I also asked upstream to include your files, I hope that's ok with you !


  2. Hi,

    Upstream asked me if there your files were under the LGPL license. Please let me know if its ok to include your work in upstream and the type of license you associate with it.

    Thanks !!


  3. Please respond to the last comment at They are waiting for you to answer yes to this question:

    Do you agree if we include it in gtksourceview upstream relicensing them as LGPL v.2.1 or later?

    I'd love to see Groovy syntax support get officially added to Gnome. Thanks for your contribution.

  4. Thanks!! Great job. Works with fedora 10. Never knew gedit could be so powerful.

  5. No problem Derek.

    I just wish they'd put it in by default.

  6. Sorry, but does not work with me for Ubuntu 9.10. See instead.

  7. Anonymous12:06 PM

    Muchas gracias por tu miniguia, está excelente.

  8. Just a note for current googlers, this method will yield namespace warnings on Ubuntu Lucid (10.4) - and it doesn't work.

    However, not to worry, I found which works great. Just git clone the URL and execute the script. I got a warning about a grails directory not existing, but simply commented that line out and ran the script again and was happy coding in gedit w/ syntax highlighting for .groovy files.