IntelliJ IDEA 13.1 Web Help

File | Settings | IDE Settings | Editor - Auto Import

settings

Java

Item Description
Insert imports on paste Use this drop-down list to define how IntelliJ IDEA will insert imports for pasted blocks of code, if they contain references to classes that are not imported into the target class. The available options are:
  • All - select this option to have IntelliJ IDEA automatically add import statements for all classes that are found in the pasted block of code and are not imported in the current class yet.
  • Ask - if this option is selected, when pasting code blocks, IntelliJ IDEA will open a dialog box, where you can choose the desired imports.
  • None - select this option to suppress import.

Tip

If you skip an import suggested in the Ask mode or choose the None mode, the non-imported classes will be red-highlighted and an import pop-up window will appear to help you create import statements using the Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt EnterAlt EnterCommand 1 keyboard shortcut.

Show import pop-up Automatically display import pop-up dialog box when typing a name of the class that lacks import statement.
Optimize imports on the fly Select this check box to have have the Optimize Imports operation automatically performed for your files.
Add unambiguous imports on the fly Select this check box to have IntelliJ IDEA automatically add imports that can be added without user intervention.
Exclude from Import and Completion In this area, create a list of packages and classes that should not be automatically included in the import statements. Use:
  • add (Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+Insert or Ctrl+NAlt+InsertCommand N or Control EnterControl N or Control EnterCommand N or Control Enter) to open the Exclude Package dialog box, where you can specify a package or class to be excluded from import and completion.
  • delete (Alt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteCommand Delete or Command BackspaceCommand DeleteCommand Delete or Command Backspace) to remove the selected item from the list.

XML

Item Description
Show import pop-up Automatically display an import pop-up dialog box when typing the name of an unbound namespace.

Jsp

Item Description
Add unambiguous imports on-the-fly Select this check box to have IntelliJ IDEA automatically add imports that can be added without user intervention.

Php

Item Description
Enable auto-import in file scope Select this check box to have IntelliJ IDEA automatically import PHP namespaces, add use statements, and complete short class names on the fly when you are typing in a class or file that does not belong to any specific namespace. By default, the check box is cleared.
Enable auto-import in namespace scope Select this check box to have IntelliJ IDEA automatically import PHP namespaces, add use statements, and complete short class names on the fly when you are typing in a class or file that belongs to a certain namespace. The check box is selected by default.

See Also

Procedures:

Getting Started:

Web Resources: