Guides for SE student projects »

Intellij IDEA: Useful settings

Enabling assertions

This tweak does not apply if you use Gradle to run code even within Intellij. In that case, refer to 'Enabling assertions' sections of the Gradle tutorial.

  1. Choose RunEdit Configurations....
  2. Select the run configuration of interest.
  3. Click on Modify options link and choose Add VM options
  4. Add -ea to the VM options box.

Enabling soft wrapping

While it is common to enforce a maximum line length for code written in some languages (typically, for code made up of statements such as Java), it is also common not to enforce such a limit for source content that contain paragraph-like structures (e.g., Markdown, HTML). In such cases, you'll need to scroll the editor window horizontally to read the content, which can be a frustrating experience. Here's an example (notice how the text continues beyond the visible area of the editor window and you need to use the horizontal scrolling to see the hidden part):

Luckily, you can use the 'soft wrap' feature of Intellij to get the editor window to put line breaks in the content so that horizontal scrolling is no longer required. Here is how the same code from the above example looks after enabling the soft-wraps feature (notice how the whole text is visible now, due to the soft line breaks added by the editor):

Read this to find how to enable soft wraps.