In IntelliJ IDEA, the Code editor does not allow to move the cursor or insert white spaces bottom of the file.

Adding spaces to the end of the file is called virtual space

It disables the virtual spaces in code editor by default

This post shows multiple ways to enable virtual spaces.

This tutorial talks about multiple ways to view the Javadoc tooltip for a method in an editor.

How to enable virtual spaces or add whitespaces at end of the file.

There are 2 ways, we can do it. First using settings, Second way is using Find Actions.

Using settings: Please follow the following steps

  • Go to File > Settings or Ctrl + Alt + S to open Settings Window
  • Select Editor > General
  • In the Virtual space panel option,
  • Check the Show the virtual spaces at the bottom of the file option as given below Other options
    • Allow placement of caret after end of line
    • Allow placement of caret inside tabs.

Intellij Idea virtual space options

  • Click the Apply button and Ok to close the window
  • Now, You can add whitespaces at bottom of the file.

Using Find Actions

  • Go to Help > Find Action or use shortcut Ctrl + Shift + A to open Settings Window

  • Type Virtual Space as given below

Intellij Idea Find Action virtual space options

  • And select this option opens settings with Virtual Space panel selected

  • Check the Show the virtual spaces at the bottom of the file option

  • It shows empty spaces at the end of the file