Groovy

Using Groovy

Language Guide

Groovy Features

Modules

Examples

Useful Links

IDE Support

Support

Community

Developers

Tools we use

IntelliJ IDEA
YourKit profiler

Feeds


Site
News
Emacs Plugin

groovy-mode for emacs

I've created a quick groovy-mode for emacs, which has syntax hilighting, recognises curly brace indentation (just use the tab key), and doesn't panic about optional semicolons.


I've tested it in emacs on Mac OSX 10.3, and it isn't painful.

Download

Download this groovy-mode.el file and place it somewhere like (on OSX)


/usr/share/emacs/site-lisp/groovy-mode.el


your mileage may vary…

.emacs

add the following lines to your ~/.emacs file:

;;; turn on syntax hilighting
(global-font-lock-mode 1)

;;; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start
(autoload 'groovy-mode "groovy-mode" "Groovy editing mode." t)
(add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode))
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))

TODO

  • check this works in xemacs, and put your results in this page (anyone can edit )
  • sort out the comment blocks, as it is currently based on ruby, where the symbol # currently denotes the start of a comment, maybe this can be cribbed from java-mode...
  • at the moment you have to hit tab to do indents, I'm sure emacs can do this automatically on carriage return...

Disclaimers

  • based upon ruby-mode in ruby stable snapshot - Wed Nov 24 04:01:06 JST 2004
  • This is just a quick hack of a groovy-mode, so if it's broken for you, fix it and share with the world.

cheers,jez.


http://javanicus.com/blog2