1.文件>首选项>设置
向下滑动找到以下图片内容点击
image.png
添加如下代码
"editor.detectIndentation": false,
"editor.tabSize": 4,
image.png
2.在项目根目录中创建.editorconfig文件
root = true
[*]
charset = utf-8
indent_style = tab
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
3.安装插件Beautify 格式化插件
image.png
使用方法:
找到您需要格式化的代码文件,按F1 然后选择你要格式化的文件类型
先点击
image.png
然后
image.png
就大功告成了













网友评论