IntelliJ Community edition customize for grails

This post will do customization on IntelliJ Community edition showing how to use it for grails 3 projects. This customization for IntelliJ can be apply it to any framework.

In this post:

  • Add HTML highlighting for gsp files
  • Stop warnings for grails namespaces
  • Install additional plugins for grails
  • Remove tabs

Add HTML highlighting for gsp files

It's better to use HTML for your gsp files for grails. OTherwise they will be treated as plain text which is unconfortable. To change file association in IntelliJ do:

  • File
  • Settings
  • Editor - or search for File Types
  • Recognized File Types
  • Find HTML
  • Add `*.gsp in Registerd Patterns

Stop warnings for grails namespaces

If you use community edition for grails all tags with grails namespace like <g:if> will error with:

namespace is not bound

In order to solve this problem:

  • File
  • Settings
  • Editor - or search for Inspections
  • Inspections
  • XML
  • Unbound XML namespace prefix - you can locate it by search
  • Change severity to: No highlighting, only fix

The other solution is:

  • go to your grails tag - <g:if>
  • ALT+ENTER
  • Create namespace declaration - you may need to press CTRL+F1 in order to avoid adding namespace for: xmlns:g="http://www.w3.org/1999/xhtml"
  • Edit inspection profile setting
  • Unbound XML namespace prefix - you can locate it by search
  • Change severity to: No highlighting, only fix

Install additional plugins for grails

You can benefit from additional plugins in IntelliJ. For example you can add GitIntegration plugin to ease your work with git or svn:

  • File
  • Settings
  • Plugin
  • Search for your plugin - for example GitIntegration or Groovy
  • Install jetBrains plugin

enjoy the support of your new plugins.

Useful Grails plugins:

  • groovy
  • gradle
  • GitIntegration
  • YAML
  • I18n for Java
  • JUnit

Remove tabs

This customization is a general one used to increase your performance while working with IntelliJ. Initially you may find it hard to work without tabs but after while you will find it much faster and easier:

  • File
  • Settings
  • Editor - or search for File Types
  • General
  • Editor Tabs
  • Tab appearance
  • Change Placement to None

In order to speed up you IntelliJ searching abilities use:

  • CTRL+SHIFT+E - recently edited files
  • CTRL+SHIFT+F - search file content in the whole project or File in path
  • CTRL+SHIFT+N - search for file names

Related Article