Make LF the default newline format

I’m on a windows box and every time I create a file I have to remember to change from clrf to lf and if I forget I blow up the ci server. Is there anyway to make LF the default even on a windows box?
Thanks,
R

2 Likes

Settings -> Packages -> Line Ending Selector -> change the “Default line ending” setting to “LF” instead of “OS Default”.

8 Likes

awesome!!! thank you. Perhaps I should have been able to find that. I did try, just a lot of stuff for me to get used to.
Thanks,
R

Thanks! Is a piece of valuable information. I just wanted use always LF, but atom always was using the CRLF by default when I’m on Windows. Really, years with this “problem”.

Also, useful for tools like https://atom.io/packages/atom-beautify that fixed my code, but leading the CRLF line ending and was not able to change it.

This was definitely it for me. Not sure how it happened, if I downloaded from a linux box on to the windows development machine and then uploaded to another linux box, but somehow all my files started to have a line in between; used a white lines deletion plugin until I realized it was the CRLF/LF thing. I installed Line Ending Selector and voilá. Then I used dos2unix (or endlines, an improved utility) in the command line and fixed all in a batch. VSCode has this CRLF/LF ability out of the box by the way, but I keep using Atom for the Remote FTP plugin.

Let me throw in two more options, that everybody should know about.

  1. https://editorconfig.org

  2. Configuring Git to handle line endings - GitHub Docs

Both are especially useful, when you work collaboratively across multiple operating systems with different defaults