Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EOL option #2957

Closed
egamma opened this issue Feb 12, 2016 · 23 comments
Closed

Add EOL option #2957

egamma opened this issue Feb 12, 2016 · 23 comments
Assignees
Labels
feature-request Request for new features or functionality important Issue identified as high-priority

Comments

@egamma
Copy link
Member

egamma commented Feb 12, 2016

twitter thread https://twitter.com/domenic/status/697921719529398272
image

@stkb
Copy link
Contributor

stkb commented Feb 12, 2016

+1 An option to change the default on Windows would be nice.

@alexdima alexdima added this to the Feb 2016 milestone Feb 16, 2016
@alexdima alexdima added the feature-request Request for new features or functionality label Feb 16, 2016
@egamma
Copy link
Member Author

egamma commented Feb 19, 2016

image

@egamma egamma modified the milestones: March 2016, Feb 2016 Feb 19, 2016
@egamma egamma mentioned this issue Feb 19, 2016
@glen-84
Copy link

glen-84 commented Feb 20, 2016

Duplicate of #1546?

@egamma egamma modified the milestones: Feb 2016, March 2016 Feb 21, 2016
@egamma egamma added the important Issue identified as high-priority label Feb 21, 2016
@egamma egamma changed the title Review default line break handling Add EOL option Feb 21, 2016
@alexdima
Copy link
Member

639a3cb

@egamma
Copy link
Member Author

egamma commented Feb 24, 2016

@alexandrudima i'll add this to the feb plan, so that we do not forget to release note the feature

@egamma egamma mentioned this issue Feb 24, 2016
97 tasks
@alexdima alexdima assigned joaomoreno and unassigned alexdima Feb 26, 2016
@edgariscoding
Copy link

Is there a way to set LF line endings as default?

I looked in Preferences > User Settings but didn't see a setting for this.

My Surface + Visual Studio Code are used as extensions of my Linux/Mac environment. I'll never need CRLF so I have to constantly change from CRLF to LF when I create new documents. If I forget to do this it causes trouble.

@glen-84
Copy link

glen-84 commented Mar 23, 2016

@edgr-sanchez

"files.eol": "\n"

@edgariscoding
Copy link

@glen-84

Perfect, thank you!

@ghost
Copy link

ghost commented Jan 11, 2017

@glen-84
nice job! thanks

@smithyj
Copy link

smithyj commented Feb 25, 2017

thank you @glen-84

@tharrison159
Copy link

I have "files.eol": "\n" set in my user preferences but whenever I open a project it always defaults to clrf, any ideas why it's still doing this?

@smithyj
Copy link

smithyj commented Mar 2, 2017

@tharrison159 yes,a project in vscode it always defaults to crlf, because vscode set user preferences is into a project

@tharrison159
Copy link

I am working on a project that is shared between unix systems and windows so the line breaks need to be LF not CLRF, is there anyway to convert the whole project to LF?

@smithyj
Copy link

smithyj commented Mar 2, 2017

use git and set git config --global core.autocrlf true / false / input

@smithyj
Copy link

smithyj commented Mar 2, 2017

@tharrison159 What are your FB account or TW account

@jsilvermist
Copy link

This should be better documented, nothing comes up when searching for lf or crlf in the settings.

@alexdima
Copy link
Member

Pushed a change to improve the documentation

screen shot 2017-05-20 at 11 45 13

@strattonbrazil
Copy link

Something that's not entirely obvious to many, but it seems that if there are already CRLFs in the existing file, VSC will fallback to using those. After seeing CRLFs introduced in the change log, I tried a different file and didn't see them added. I also saw in settings it was already set to use LF. When I ran dos2unix on the offending file and then when back and added a new line, I no longer saw the CRLFs. This seems to match the functionality I've seen on some other editors.

TL;DR If you're seeing CRLFs and your settings are using LF, you might need to remove the existing CRLFs in the file or else the editor will fall back to using those for consistency across lines.

@grobmeier
Copy link

Actually @strattonbrazil is right. I had the same problem: there was a CRLF in a css file which caused VSC to write CRLF, even when I had "files.eol": "\n",

Running "dos2unix" fixed the problem entirely. The git config didn't help, it just fixes the changed lines (I think)

@rsmolkin
Copy link

So I'm having the same problem. Working on a team where some have Macs and some have Windows. My files.eof is set to "\n" but every time I open a file it still shows crlf in the bottom blue bar and my eslint freaks out, so I have to change it every time I open a file. How can we set this to be default not just on new files but for every file in a project?

@drkmullins
Copy link

Was having similar issues to @rsmolkin and seemed to resolve it by adding *.js text eol=lf
to my .gitattributes file as mentioned in the linebreak-style rule docs

@rsmolkin
Copy link

@drkmullins Thanks for the find. Can you clarify if this is for the global Git directory where Git is installed, or local to each project in the .git/info/ directory. The only file I see in there is exclude, but I guess I can add .gitattributes with that one line in it?

@bialix
Copy link

bialix commented Oct 10, 2017

Is it possible to configure line-endings settings per file type? E.g. LF for python files, but CRLF for batch files?

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality important Issue identified as high-priority
Projects
None yet
Development

No branches or pull requests

15 participants