VSCODE新增的文件总是CRLF格式,需要手动去切换成LF

有可能是没安装 EditorConfig for VS Code 插件,看项目是否有.editorconfig文件,有则不需要再做其他操作,ctrl + S 保存一下文件就可以切换了。

没有则需要再项目根目录下新建.editorconfig文件。内容如下:

# http://editorconfig.org
root = true
 
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
 
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
posted @ 2022-12-09 10:44  胡姐姐  阅读(1887)  评论(0编辑  收藏  举报