Set default Line endings to unix on windows workstation


#1

I am using the awesome ATOM on windows (urfortunately). So having this problem with line endings.
Was using sublime Text till now which had this inbuilt and i could set default to unix line endings.

Downloaded a line ending package Line Ending Conveter but then i have to mannually select all the text and run it, is there a config where i can set it to default such that my line endings are set to unix line endings by default.


Can newlines be configured? (eg. \r\n or \n)
#2

I highly recommend this plugin: http://editorconfig.org/


#3

Thankyou will give it a try


#4

@dannyfritz doesn’t that just abstract the configuration parameters into a different format? What is the Atom configuration parameter that controls that behavior?


#5

@jmm I went to editorconfig and decided to have a look, but it turns out it doesn’t do line endings at all. :scream:


#6

Has there been ANY development on this subject?

Right now I am forced to again ditch Atom editor and go back to Sublime, because I cannot actually work.


#7

I know it does not change atom, you can configure git for windows to check out as windows line endings and commit as Unix line endings. this means you can work with the files In windows and not have to update them in the source repository.


#8

The issue is still open


#9

As a matter of fact git defaults to this and you will have serious problems with git if you change it. I don’t remember the details at the moment but you can google it.


#10

I got similar issue , also thought it is problem with line ending , applied the editorconfig doesn’t work . finally found it was whitespace plugin (Strips trailing whitespace and adds a trailing newline when an editor is saved) , after disabling it all good now


#11

It didn’t work for me, this is what I did see if you can reproduce from your end

  1. Disabled whitespace plugin
  2. Modified file (in atom)
  3. Checkout head revision (ctrl-alt-z)
  4. Check diff (git diff), changes shows with line endings

#12

I don’t know if it matters now, but I made an alternate version of line-ending-selector that uses unix newlines by default even on windows.

I just assumed the use case of wanting windows newlines on linux and mac was less likely.


#13

I don’t know if this is new since Sep 10, but the atom-default package line-ending-selector does in fact have a Default line ending for new files setting. Which works on Windows, if you’re wondering :smile:


#14

this was it for me :slight_smile:


#15

Just incase anybody else stumbles on this thread, it worked just fine for me by going to the settings of the Core package line-ending-selector and changing the Default line ending to LF instead of OS Default.

This should take care of it and is built-in.