-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Comments
+1 An option to change the default on Windows would be nice. |
Duplicate of #1546? |
@alexandrudima i'll add this to the feb plan, so that we do not forget to release note the feature |
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. |
@edgr-sanchez "files.eol": "\n" |
Perfect, thank you! |
@glen-84 |
thank you @glen-84 |
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? |
@tharrison159 yes,a project in vscode it always defaults to crlf, because vscode set user preferences is into a project |
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? |
use git and set |
@tharrison159 What are your FB account or TW account |
This should be better documented, nothing comes up when searching for |
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. |
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 Running "dos2unix" fixed the problem entirely. The git config didn't help, it just fixes the changed lines (I think) |
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? |
Was having similar issues to @rsmolkin and seemed to resolve it by adding |
@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? |
Is it possible to configure line-endings settings per file type? E.g. LF for python files, but CRLF for batch files? |
twitter thread https://twitter.com/domenic/status/697921719529398272
The text was updated successfully, but these errors were encountered: