# 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.

Procedure: Configure line separators for new files

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Editor | Code Style`.

> **Tip:**
> To configure line separators [for new projects](configure-project-settings.html#new-default-settings), go to `File | New Projects Setup | Settings for New Projects | Editor | Code Style`.

2. Select the code style Scheme that you want to modify: the [Project](configuring-code-style.html#project-scheme) scheme or one of the [IDE-level scheme](configuring-code-style.html#default-scheme).

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

* System-Dependent: select this option to use the separator default for your OS.

* Unix and macOS ( ): select this option to use the Unix and macOS line separator.

* Windows ( ): select this option to use the Windows line separator.

* Classic Mac OS ( ): select this option to use the `\r` line separator, which was used in [Classic Mac OS](https://en.wikipedia.org/wiki/Classic_Mac_OS) (up to Mac OS 9).

4. Apply the changes and close the dialog.

![Line Separator for new files](https://resources.jetbrains.com/help/img/idea/2026.2/lineSeparatorForNewFiles.png)

Procedure: Change line separators for the current file

The line separator widget appears in the [status bar](guided-tour-around-the-user-interface.html#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](https://resources.jetbrains.com/help/img/idea/2026.2/uiStatusLineEnding.png)

* Alternatively, select another ending style in `File | File Properties | Line Separators`.

Changing the line separator style is reflected in the [Local history](local-history.html) of a file.

> **Tip:**
> If you cannot see the line separator widget in the status bar, go to `View | Appearance | Status Bar Widgets` in the main menu and enable the Line Separators option.

Procedure: Change line separators for a file or directory

1. In the    Project  tool window (`Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+1` (NetBeans), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS)) 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.

> **Tip:**
> Run the Inconsistent line separators inspection to find out which files use line separator that differs from the project's default   . Learn more about running inspections from [Run a single inspection](running-inspections.html#run-one-inspection).

## See also

### Procedures

[EditorConfig](editorconfig.html) [Code style schemes](configuring-code-style.html) [Reformat code](reformat-and-rearrange-code.html)

### Reference

[Settings | Code Style](settings-code-style.html) [Settings | Code Style | Java](code-style-java.html)

