Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enforce LF line endings in Jetbrains Rider 2018.1

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.

like image 605
Robert Avatar asked Jun 07 '18 14:06

Robert


1 Answers

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.

like image 84
andrej88 Avatar answered Oct 19 '22 12:10

andrej88