A release was made on 2010-11-13 (but there was a fault with the tarball that was corrected 2011-06-29, hence the date on the tarball) and this can be downloaded from the project's page on Launchpad, but many people using this mode just branch the Bazaar branch that is the mainline. The Bazaar branch held at lp:groovy-emacs-mode is the current mainline. See https://launchpad.net/groovy-emacs-mode.it is recommended that people track the mainline rather than use releases.
The mainline is a Git repository held at the project's page on GitHub.
Getting and Installing Groovy Mode
- Download the tarball from the Groovy Emacs Mode page on Launchpad.
- Extract the content of the downloaded tarball to your ~/.emacs.d file (for Linux, Unix and Mac OS X), whatever the equivalent is for Windows.
- Update your ~/.emacs.d/init.el or ~/.emacs file as needed to set up the appropriate autoload configuration. See "Setting Up Emacs" below.
- Restart Emacs if it is already running.
For developers, or the more adventurous users who want to work with continuous update, then take a branch of the mainline somewhere on your filestore:
- bzr branch lp:groovy-emacs-modegit clone git://github.com/russel/Emacs-Groovy-Mode.git Emacs-Groovy-Mode
This creates a Bazaar branch Git repository in the subdirectory groovyGroovy-emacsEmacs-mode Mode of the current directory. You can update to the latest version by:
- cd groovyGroovy-emacsEmacs-modeMode
- bzr git pull
On systems other than Windows you can use symbolic links to put these files in the right place for Emacs to find them. So assuming that you put the Groovy mode branch in ~/groovy-emacs-mode and your emacs directory is ~/.emacs.d then:
- cd ~/.emacs.d
- ln -s ../groovyGroovy-emacsEmacs-modeMode/*.el .
this should set up all the symbolic links needed.
Emacs needs to be told when to use Groovy mode. So in your initialization file (assumed default is ~/.emacs.d/init.el) you probably want to add:
;;; turn on syntax highlighting (global-font-lock-mode 1) ;;; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start (autoload 'groovy-mode "groovy-mode" "Major mode for editing Groovy code." t) (add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode)) (add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode)) ;;; make Groovy mode electric by default. (add-hook 'groovy-mode-hook '(lambda () (require 'groovy-electric) (groovy-electric-mode)))