How do I enforce LF line endings in Jetbrains Rider 2018.1

11,126

To change the default line ending for new files, Go to FileEditorSettingsCode Style and in the "Line Separator" dropdown select "Unix and OS X (\n)".

To change the line endings of existing files, select the files in the "Project" view panel, then go to FileLine SeparatorsLF - Unix and OS X (\n). Make sure you don't break anything though - some file formats (eg .bat) only work with specific line endings.

Share:
11,126
Robert
Author by

Robert

I'm a lead frontend web developer, architect currently working with Angular, Stencil and all the other SPA related technologies.

Updated on June 04, 2022

Comments

  • Robert
    Robert almost 2 years

    I'm frequently running into line ending issues with my JetBrains Rider 2018.1 installation under Windows 10. The IDE turns existing LF files into CRLF files once I edit them. I haven't yet found a way to configure it the way I want.

    I would like to always only have LF in my files (for new ones and for edited ones). During a commit process, I don't want to get distracted by line ending changes.

    My git is set to core.autocrlf=input. So it should behave neutral and use the as-is settings.

    I know I can edit each file manually via the Line Ending switch button on the bottom right of the editor, but I feel that is quite cumbersome.

  • Robert
    Robert almost 6 years
    I know. I tried that. I edit the file again and it switches back to CRLF again although I set it to LF before.
  • andrej88
    andrej88 almost 6 years
    @Robert If you go to Code Style, there should be a "Scheme" dropdown at the top where you can select "Default (IDE)" or "Project". Perhaps one of them has line endings still set to CRLF and is overriding the other?
  • Gregory Fenn
    Gregory Fenn over 3 years
    Just a warning for Unity3D users - setting the line endings for files can trigger a global asset reimport without warning, which can take ages and it just a pain.