发布于 2018-01-18 07:15:28
我收到了vscode项目的github的解决方案。
对我来说很管用。编辑您的keybindings.json
,添加以下文本:
{
"key": "]",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "]"
}
},
{
"key": "Shift+]",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "}"
}
},
{
"key": "Shift+0",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": ")"
}
}
注意:"Shift+0“表示en键盘(
,将其编辑为键盘布局。
发布于 2017-10-26 15:23:33
这确实是编辑器的autoClosingBrackets设置的一个副作用。
如果您转到 file > Preferences > settings 打开设置JSON文件,您可以搜索“编辑器”或"autoClosing“,如果您希望更改/禁用它(默认情况下启用),则可以搜索”编辑器“或”autoClosing“,或者只需复制它以禁用它:
// Controls if the editor should automatically close brackets after opening them
"editor.autoClosingBrackets": false,
关于VS代码设置的更多信息,以及默认设置的列表,可以在这里找到:https://code.visualstudio.com/docs/getstarted/settings
如果禁用此设置:
https://stackoverflow.com/questions/46589115
复制