How to make all line endings (EOLs) in all files in Visual Studio Code, UNIX like?
The accepted answer explains how to do this for all files (use files.eol in settings), but if you ever need to override that setting there's an indicator at the bottom right that you can click on and change for this one file. Took me a while to notice that this was clickable.
In your project preferences, add/edit the following configuration option:
"files.eol": "\n"
This was added as of commit 639a3cb, so you would obviously need to be using a version after that commit.
Note: Even if you have a single CRLF
in the file, the above setting will be ignored and the whole file will be converted to CRLF
. You first need to convert all CRLF
into LF
before you can open it in Visual Studio Code.
See also: https://github.com/Microsoft/vscode/issues/2957
You can find the option in vscode settings. It's under "Text Editor" > "Files" > "Eol". Here you can select whether you want \n or \r\n or auto.