IntelliJ IDEA 2021.1 Help

File Types

File | Settings | Editor | Copyright | Formatting | <File Type> for Windows and Linux
IntelliJ IDEA | Preferences | Editor | Copyright | Formatting | <File Type> for macOS
Ctrl+Alt+S
Settings

This page describes controls. For information on how to configure a copyright notice, refer to Copyright.

ItemDescription
No copyrightIf this option is selected, the copyright notice will not be updated in the files of the selected type.
Use default settingsIf this option is selected, the copyright notice will be updated according to the. default settings for new projects.
Use custom formatting optionsIf this option is selected, the copyright notice in the files of the selected type will be updated according to the custom settings defined below.
Comment Type

In this area, specify the type of comment to enclose copyright notices in. The available options are:

  • Use block comment: select this option to have copyright notices enclosed in block comments.

  • Prefix each line: select this checkbox to have each line of a copyright notice prepended with the character defined in the Separator field. By default, an asterisk is used.

  • Use line comment: select this option to have copyright notices represented as a sequence of line comments.

Borders

In this area, define how to separate copyright notices from other comments.

  • Separator before: select this checkbox have a copyright notice prepended with a line of characters defined in the Separator field.

  • Separator after: select this checkbox have a copyright notice followed by a line of characters defined in the Separator field.

  • Separator: in this field, type the character that will be used in the separator strings and as a prefix or ending character in block comments.

  • Length: in this field, type the number of characters in a spartor line.

  • Box: select this checkbox to have each line of a copyright notice followed by a character defined in the Separator field.

  • Add blank line after: select this checkbox to have a blank line inserted after a copyright notice.

Relative Location

In this area, specify the location of a copyright notice relative to other comments.

  • Before other comments: when this option is selected, copyright notices are inserted above other comments.

  • After other comments: when this option is selected, copyright notices are inserted below other comments.

PreviewUse this area to view a sample copyright notice with the formatting you have defined.
Location in File

Use this area to specify the location of the copyright notice in a file. Depending on the file type, the available options are:

  • JAVA
    • Before the package statements

    • Before imports

    • Before the class declaration

  • HTML, JSP, JSPX, XML

    • Before the root tag

    • Before the Doctype statement

  • For Properties, PHP, JavaScript, CSS, SCSS, and SASS file types no choice is available. Copyright notices are always inserted at the top of a file.

Last modified: 21 June 2021