我是一名长期的视觉工作室开发人员,并且正在讨论VSCode。
我找到了“格式代码”快捷键(Shift + alt + f),但我希望每按一次“;”就会自动运行。有配置吗?
您可以选择以下选项之一
"editor.formatOnType": false,
"editor.formatOnPaste": false,
"editor.formatOnSave": false
或者通过编辑editor.action.formatDocument
创建自定义键盘快捷键。但是当我按下;
时,我无法执行命令。你可以设置键盘快捷键,但我想你再也不能写;
了:D
要打开user and workspace settings,请使用以下VS Code菜单命令:
在Windows / Linux上 - “文件”>“首选项”>“设置”
在macOS上 - 代码>首选项>设置
将这些选项添加到配置设置的可编辑面板中:
"editor.formatOnPaste": true,
"editor.formatOnSave": true