在 vscode 中禁用自动花括号或括号插入 [英] disable automatic curly brace or bracket insertion in vscode

查看:53
本文介绍了在 vscode 中禁用自动花括号或括号插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 vscode 中关闭自动关闭大括号插入?我一一检查了编辑器设置并关闭了与格式相关的所有内容,但我没有看到任何专门针对此的内容.

Is there a way to turn off automatic closing curly brace insertion in vscode? I've gone through the editor settings one by one and turned off everything that was related to formatting, but there was nothing I saw specifically for this.

例如,当我输入类似内容时

For example, when I type something like

function()
{

vscode 立即添加 } 这样我就得到了

vscode immediately adds } so that I end up with

function()
{}

然后,我按回车键,它会自动缩进光标.我不希望它做任何事情.我不希望它自动插入任何结束字符或任何缩进.我基本上只是希望它停止帮助我,让我以我想要的方式打字.但我不知道是否有任何设置?

Then, I press enter, and it has automatically indented the cursor. I don't want it to do any of that. I don't want it to auto insert any closing character or any indentations. I basically just want it to stop helping me and let me type the way I want to type. But I cannot figure out if there is any setting for this?

我可能是这个词中唯一想要这个功能"的人,所以如果这不可能,我不会感到惊讶.

I'm probably the only person in the word who wants this "feature" so I won't be surprised if this isn't possible.

推荐答案

vscode 的更高版本已将此更改为:

A later version of vscode has changed this to:

editor.autoClosingBrackets":从不"

您也可以通过以下方式以特定于语言的方式执行此操作

You can also do this in a language-specific way by

"[javascript]": {
    "editor.autoClosingBrackets": "never"
}

always"languageDefined"beforeWhitespace" 是新的附加选项.

"always", "languageDefined", and "beforeWhitespace" are the new additional options.

[以前的,现在不准确的设置.]

//控制编辑器打开后是否自动关闭括号

// Controls if the editor should automatically close brackets after opening them

"editor.autoClosingBrackets": false,

这篇关于在 vscode 中禁用自动花括号或括号插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆