Reputation: 343
Generally me and my developers prefer UNIX line endings. I have updated the setting in VSCode for end of line settings to the following...
"files.eol": "\n"
This seems to work when creating new files, however any pre-existing file from our source code is defaulted to CRLF. Is there any way that I can set our end of lines to \n across all files, even pre-existing files from our repo's source code?
Upvotes: 3
Views: 1213
Reputation: 12739
When VSCode opens a file, if the file has at least one line terminator in it, its per-file EOL value will be set according to whatever is the most common line terminator in the file, regardless of files.eol
. That means that if files are opening as CRLF, then those files are already CRLF on disk.
My guess is your SCM is checking them out with CRLF endings and you probably can adjust its configuration so it checks them out as LF instead.
Upvotes: 2