Can I set the VS Code default EOL based on file type?

前端 未结 3 1484
执念已碎
执念已碎 2021-01-18 07:19

Working with .sh files on Windows causes issues when running them in Linux Docker containers if they have EOL of CRLF. Can I make VS Code always work with LF fo

3条回答
  •  自闭症患者
    2021-01-18 07:54

    You can use EditorConfig.

    Install the editorconfig extension, and then add a .editorconfig file at the root of your project with this:

    [*]
    end_of_line = crlf
    
    [*.{sh}]
    end_of_line = lf
    

    But as @axiac said, I would recommend to always use lf...

提交回复
热议问题