如何在 Eclipse 中禁用大括号({})的自动创建?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7374119/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:58:41  来源:igfitidea点击:

How to disable auto creation of curly brackets({}) in eclipse?

javaeclipse

提问by Avery3R

When I write

当我写

if(true)
{

eclipse auto-completes it to

eclipse 自动完成它

if(true)
{
    //cursor here
}

Which gets annoying when I want to write an else or else if. Any way to disable it?

当我想写一个 else 或 else if 时,这会很烦人。有什么办法可以禁用吗?

回答by Bart Kiers

From Eclipse's main window, choose Windowand then Preferences. Then choose Java, Editorand then Typingto get the following screen:

在 Eclipse 的主窗口中,选择Window,然后选择Preferences。然后选择JavaEditor然后Typing得到以下屏幕:

enter image description here

在此处输入图片说明

and un-check {Braces}.

并取消选中{Braces}

Tested on Eclipse Helios.

在 Eclipse Helios 上测试。