Created
June 20, 2011 01:17
-
-
Save matthewmccullough/1034984 to your computer and use it in GitHub Desktop.
Wiring Groovy emacs mode to Gradle files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Get the Groovy support for Emacs from http://svn.codehaus.org/groovy/trunk/groovy/ide/emacs | |
;; Symlink the downloaded Groovy support into your .emacs.d folder as "groovy" | |
;;; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start | |
(add-to-list 'load-path "~/.emacs.d/groovy") | |
(autoload 'groovy-mode "groovy-mode" "Major mode for editing Groovy code." t) | |
;; For some reason, these recommendations don't seem to work with Aquamacs | |
(add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode)) | |
(add-to-list 'auto-mode-alist '("\.gradle$" . groovy-mode)) | |
;; This does work with Aquamacs | |
(add-to-list 'auto-mode-alist (cons "\\.gradle\\'" 'groovy-mode)) | |
(add-to-list 'auto-mode-alist (cons "\\.groovy\\'" 'groovy-mode)) | |
;; This _might_ not work with Aquamacs (not sure what value it offers) | |
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode)) | |
(add-to-list 'interpreter-mode-alist '("gradle" . groovy-mode)) | |
;;; make Groovy mode electric by default. | |
(add-hook 'groovy-mode-hook | |
'(lambda () | |
(require 'groovy-electric) | |
(groovy-electric-mode))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment