How to make all line endings (EOLs) in all files in Visual Studio Code, UNIX like?

后端 未结 6 557
有刺的猬
有刺的猬 2021-01-01 08:36

I use Windows 10 home and I usually use Visual Studio Code (VSCODE) to edit Linux Bash scripts as well as PHP and JavaScript.

I don\'t develop anything dedicated for

6条回答
  •  萌比男神i
    2021-01-01 09:13

    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

提交回复
热议问题