禁用右括号吞咽?

alv*_*awa 8 visual-studio-code vscode-settings

当你把光标放在a前面],)或者}你输入那个字符,而不是插入它时,vscode只是移过那个字符,]*cursor here*而不是生成]*cursor here*].因此,每次我需要插入一个右括号时,我需要移动))))到键入它的末尾,而不是直接键入它.那么有没有办法禁用此行为(不禁用括号自动完成)?

是同样的问题,但对于崇高的文本,这个人提到它是自动关闭括号的副作用.

小智 10

我收到了来自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": ")"
}
}
Run Code Online (Sandbox Code Playgroud)

注意:键盘的"Shift + 0" (,编辑键盘布局.

  • 我希望我可以为你买一杯啤酒! (3认同)

归档时间:

查看次数:

951 次

最近记录:

6 年,6 月 前