How can I make all line endings (EOLs) in all files in Visual Studio Code, Unix-like? How can I make all line endings (EOLs) in all files in Visual Studio Code, Unix-like? windows windows

How can I 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.

See CRLF in the message bar at the bottom right


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


I searched for a simple solution for days and didn't have any success after I found some Git commands that changed all files from CRLF to LF.

As pointed out by Mats, make sure to commit changes before executing the following commands.

In the root folder type the following.

git config core.autocrlf falsegit rm --cached -r .         # Don’t forget the dot at the endgit reset --hard