Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Add setting to set default line-endings for new files #5

Closed
clintwood opened this issue Aug 30, 2015 · 11 comments · Fixed by #7
Closed

Add setting to set default line-endings for new files #5

clintwood opened this issue Aug 30, 2015 · 11 comments · Fixed by #7

Comments

@clintwood
Copy link
Contributor

Hi, I work on Windows but always use just LF. Since this landed all my new files are by default CRLF which is not what I want.

Please add a setting to override the platform default for new files. Actually, ideally, an override per file extension type :)

@traverse
Copy link

traverse commented Sep 5, 2015

👍 Would be awesome because having to convert from CRLF to LF for every new file I create is getting tedious.

@BujiasBitwise
Copy link

I would also like to see this.

@jonasahlsson
Copy link

I am too a Windows user looking for a way to set default to LF.

Thanks in advance!

@hho
Copy link

hho commented Sep 21, 2015

👍

In fact, we don't need a setting. Just make sure the default is always LF. It's not 1995 anymore, even Windows can now handle ".cmd" batch files with LF line endings.

@Calinou
Copy link

Calinou commented Sep 24, 2015

It's not 1995 anymore, even Windows can now handle ".cmd" batch files with LF line endings.

I think notepad.exe in Windows 7/8/8.1/10 still can't display files with LF line endings properly, though; it sadly remains the default text editor on Windows.

@fbourigault
Copy link

👍
I'm using atom and vagrant to dev symfony2 apps so I will never want a file ending with CRLF !

@Keavon
Copy link

Keavon commented Oct 4, 2015

Please add this, it's pretty easy to forget to set it to LF from CRLF when making new files.

@davidspiess
Copy link

I would also like to have this setting!
As a workaournd you can create a .editorconfig file with something like this

# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

And install the following plugin https://github.com/sindresorhus/atom-editorconfig

@oh-ren
Copy link

oh-ren commented Oct 9, 2015

Thanks for sharing @davidspiess, will look into that.
There's also this: https://atom.io/packages/line-ending-selector-unix (remember to disable the built-in package).

+ in the meantime, let's wait for an update on PR #7?

@keweilizhe
Copy link

i have solution now.

You can change the default line ending setting for new files within Atom.

Atom version 1.0.8 introduced the line ending selector package which allows you to change the line ending setting for the current file by selecting LR (Unix based) or CRLF (Windows based) within the Atom status bar.

This is useful for existing files, but by default for new files the package will use the OS default (LF on Unix, CRLF on Windows). It is recommended in general that you use LF line endings throughout. To change the default line endings for new files, follow these steps:

Select File->Settings
Select ‘Packages’
Under Core Packages->line-ending-selector, select ‘Settings’
Under the ‘Default line ending’ setting, choose ‘LF’ in the dropdown
You new files will now use LF as the default line ending setting. You can confirm this in the Atom status bar.

reference: http://developmentsindigital.com/atom/2016/08/27/setting-atom-default-line-endings/

@rsn8887
Copy link

rsn8887 commented Mar 16, 2018

This is useless if you want to change the line ending on just a single line, which seems to be impossible in Atom.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.