一、快捷键的方式格式化
1.使用[shift]+[option]+[F]快捷键 或 右击点对应的菜单选项

二、保存自动格式化
1.打开设置界面

2.搜索emmet.preferences

3.打开settings.json文件,并粘贴下面两行代码
"editor.formatOnType": true,
"editor.formatOnSave": true

4.保存settings.json文件之后,再在编辑页面保存的时候就可以自动格式化了
1.使用[shift]+[option]+[F]快捷键 或 右击点对应的菜单选项
1.打开设置界面
"editor.formatOnType": true,
"editor.formatOnSave": true
本文标题:Mac下的vscode设置自动格式化代码
本文链接:https://www.haomeiwen.com/subject/vynnaktx.html
网友评论