Search This Blog

Saturday, August 11, 2012

IntelliJ: customize the editor

In this post I explain the modifications I make in the configuration of the IntelliJ editor and project window. With these modifications I find it even more easier to work with source code.

I make the following modifications to the IntelliJ editor settings:

Show method separators
This option shows horizontal lines between methods with which seperate methods are easily identified. To enable method separators do the following:
  1. Open the settings window
  2. Open Editor -> appearance and check Show method separators.
High light usages of element at caret
This option highlights all usages of the element where the caret is positioned. To enable this option:
  1. Open the settings window
  2. Click Editor and check Highlight usages of element ar caret.
Highlight current scope
This option highlights the current scope of a code block in the left gutter. To enable this option:
  1. Open the settings window
  2. Click Editor and check Highlight current scope.
Disable allow placement of caret after end of line
To disable the placement of the caret after the end of a line do the following:
  1. Open the settings window
  2. Click Editor and uncheck Allow placement of caret after end of line.
Use and show soft wraps
Soft wraps are useful when the editor window is smaller than the actual line length that can be displayed. The lines that exceed the editor window wraps to the following line.
  1. Open the settings window
  2. Click Editor and check use soft wraps in editor and Show all soft wraps.
Tab limit
The tab limit limits the maximum open tabs so the tabs remain manageable. To limit the maximum open tabs:
  1. Open the settings window
  2. Click Editor -> Editor Tabs and specify a tab limit.
Optimize imports on the fly
This option automatically optimizes the imports when you are typing code. To enable this option:
  1. Open the settings window
  2. Click Editor -> Auto Import and check Optimize imports on the fly
The results of the above modifications can be seen in the screenshot below. I made the editor window smaller than usual to demonstrate the soft wraps.


In the project window I make the following modifications:

Autoscroll to source
This option lets me autoscroll to the editor window when a file is clicked.

Flatten packages
Abbreviate qualified package names
The above two option give a nice compact but complete overview of the package structure with abbreviated names. This can be seen in the following screenshot:



Let me know which options you use.

2 comments:

Denis Zhdanov said...

Hey,

It's also convenient to configure soft wrap to use custom indent (say, two visual columns). Soft-wrapped line is shown indented to the previous line indent position then.

jcraane said...

Hi Denis,

Thanks for the tip! That makes it even more readable.

Regards,
Jamie