Configure line separators
With PyCharm, you can set up line separators (line endings) for newly created files and change the line separator style for existing files.
Press CtrlAlt0S to open settings and then select Editor | Code Style.
tip
To configure line separators for new projects, go to File | New Projects Setup | Settings for New Projects | Editor | Code Style.
Select the code style Scheme that you want to modify: the Project scheme or one of the IDE-level schemes.
From the Line separator list, select the line separator style you want to apply.
Apply the changes and close the dialog.
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.
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.
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.
In the Project tool window (Alt01 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.
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.
Thanks for your feedback!