This project provides useful Grails support for Emacs in terms of navigation and commands execution.
- Screenshot
- Keybindings discovery support
- Grails Code completion information
- Dependencies installation
- Commands
Below is a screenshot of grails-projectile-mode
in action.
The menu is displayed via guide-key with the flag guide-key/recursive-key-sequence-flag
.
In order to improve usability, support has been added for discover.el when available. This makes it easier to use commands without resorting that much to muscle memory.
You can install discover.el
via the package.el
, el-get
, Cask
or whatever other package manager
you may be using. When discover.el
is found in the Emacs load-path
, support for it will be enabled
automatically. To use the default keybindings grails-projectile-keymap-prefix
value, followed by the d
character (C-c ; d
is the original value), add this to your init file
.
(require 'grails-projectile-discover) (grails-projectile-discover-setup-keybindings)
Below is a screenshot of this feature.
- Eclim now supports Groovy , you’ll need the latest Eclim for that.
- I have a modified version of emacs-eclim to hook groovy code completion.
I use Eclim
as it’s convenient in terms of code completion for both Java and Groovy projects.
- Create a new application via
M-x grails-projectile-wizard-new-app
orM-x grails-projectile-wizard-new-plugin
. - Import the project in Eclipse via
M-x eclim-project-import
. - Refresh dependencies just in case
M-x grails-projectile-refresh-dependencies
. - Use the main
grails-projectile
commands to compile, clean or run the application. - Use
eclim
commands for content assist among other things withcompany-mode
orautocomplete-mode
.
It is recommended to use the package system to install dependencies.
You’ll likely want to start with groovy-mode
.
Add the following to your el-get-sources or user recipes
(:name grails-projectile-mode :website "https://github.com/yveszoundi/grails-projectile-mode/" :description "Grails support for Projectile." :type github :pkgname "yveszoundi/grails-projectile-mode")
Add the following entry to your Cask
file within your .emacs.d
folder.
(depends-on "grails-projectile-mode")
After installation, enable this minor mode with the code below:
(require 'grails-projectile-mode) (grails-projectile-global-mode t)
If you use discover.el
and want to integrate with it also add
the following to your setup.
(require 'grails-projectile-discover) (grails-projectile-discover-setup-keybindings)
Projectile is a nice way to manage projects in Emacs.
M-x package-install projectile [RET]
Groovy-mode brings you Groovy syntax highlighting.
M-x package-install groovy-mode [RET]
The default key prefix is C-c ;
. This can be changed by
customizing the grails-projectile-keymap-prefix
variable.
Below is the list of available interactive commands.
If you have (grails-projectile-discover-setup-keybindings)
in your init-file
,
you get the additional C-c ; d
binding that will display a popup of available commands.
KeyBinding | Description |
---|---|
C-c ; r d | Refresh dependencies |
C-c ; c p | Compile project |
C-c ; c l | Clean |
C-c ; e | Arbitrary Grails command |
C-c ; i w | Integrate with other tools |
C-c ; g a | Generate all artifacts for a domain |
C-c ; g c | Generate controller |
C-c ; g v | Generate views |
C-c ; b a | Browse api docs |
C-c ; b g | Browse latest guide |
C-c ; b w | Browse wiki docs |
C-c ; c d | Create domain |
C-c ; c t | Create taglib |
C-c ; c s | Create service |
C-c ; c c | Create controller |
C-c ; f d | Find domain for file |
C-c ; f t | Find test for file |
C-c ; f s | Find service for file |
C-c ; f c | Find controller for file |
C-c ; l d | Locate domain |
C-c ; l t | Locate test |
C-c ; l s | Locate service |
C-c ; l v | Locate view |
C-c ; l c | Locate controller |
C-c ; r a | Run application |
C-c ; n a | Create new application |
C-c ; n p | Create new plugin |
C-c ; p l | List installed plugins |
C-c ; p p | Package a plugin |