IntelliJ IDEA 2024.3 Help

Line separators

With IntelliJ IDEA, you can set up line separators (line endings) for newly created files and change the line separator style for existing files.

Configure line separators for new files

  1. Press Ctrl+Alt+S to open settings and then select Editor | Code Style.

  2. Select the code style Scheme that you want to modify: the Project scheme or one of the IDE-level schemes.

  3. From the Line separator list, select the line separator style you want to apply.

  4. Apply the changes and close the dialog.

    Line Separator for new files

Change line separators for the current file

The line separator widget appears in the status bar of the IDE window when a file is open in the editor.

  • Click the widget and select another line separator style.

    current line separator
  • Alternatively, select another ending style in File | File Properties | Line Separators.

Changing the line separator style is reflected in the Local history of a file.

Change line separators for a file or directory

  1. In the Project tool window (Alt+1 or View | Tool Windows | Project), select a file or a directory.

    If you select a directory, the new line-ending style will be applied to all nested files recursively.

  2. In the main menu, go to File | File Properties | Line Separators, and then select a line-ending style from the list.

Last modified: 11 October 2024