vscode格式化go语言代码快捷键问题
·
vscode中默认使用 'ctrl+k ctrl+f' 调整代码缩进格式,但是go语言需要使用Shift+Alt+F才可以调整缩进。
解决方案:
-
打开键盘快捷方式设置:
-
按
Ctrl+Shift+P打开命令面板。 -
输入 "Preferences: Open Keyboard Shortcuts (JSON)" ,打开可编辑的那个json文件
-
-
添加配置:
在打开的keybindings.json文件中,添加一个新的对象来重新定义Ctrl+K, Ctrl+F对于 Go 文件的行为:{ "key": "ctrl+k ctrl+f", "command": "editor.action.formatDocument", "when": "resourceLangId == 'go'" }这样设置好后,go也可以使用 'ctrl+k ctrl+f' 调整代码格式了
更多推荐


所有评论(0)