Newline character in windows



I use Atom in windows, but when I save the document, it saves with Unix style line endings ("\n") instead of Windows style ("\r\n"), so the saved document cannot be displayed properly in other windows editors
I cannot find any place discussing about this or any setting to change line endings character
Is there anyway to fix this?


Anyone else experiencing weird line endings like this?

The configuration guide explains how to do this if you look for “invisibles” on the page.


The invisibles setting just controls how CR and LF characters are displayed in Atom if they exist in the file (when the “Show Invisibles” setting is enabled). It doesn’t control whether or not they are inserted into the file on pressing RETURN.

Atom attempts to auto-detect what line ending a file uses and continues to use that. There is currently not a feature to override this nor is there an ability to specify the default as something other than the LF character. There is a feature request that can be subscribed to here:


Thanks. I really like Atom, but this is the main thing that currently holding me back from using it as main editor since I do all of my work in Windows. It would be great if Atom can integrate this feature soon


Searching the web for that exact issue with Atom I found this discussion. I agree with @hpcsc because as Windows user I would appreciate very much, to choose an appropriate newline character for my work. Otherwise I still need to use another editor, but I would like to be able to do ALL THE WORK with Atom only.

EDIT: In the meantime I have to admit, the package line-ending-converter is an adequate workaround. Anyway there is still the current line ending character in the status bar missing.


I must agree with everyone here. I have been trying out Atom which is great, but not having the ability to easily change line endings and set a default line ending has sent me back to me beloved Sublime Text :smile:


Same here. Atom effectively doesn’t changes the line endings in our existing codebase, however it always defaults to LF when I create new files. If it cannot be configured in some kind of project config, it should be the system’s default, or at least an option.


You can configure the default line ending with the line-ending-converter package.