在 Eclipse 中设置自动完成快捷方式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10448039/
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 18:08:12  来源:igfitidea点击:

Setting auto complete shortcuts in Eclipse

javaeclipse

提问by Sal

When programming Java in Eclipse, I can type sysoand press control+space to auto-complete this and get System.out.println();. I was wondering if there are settings somewhere in Eclipse to allow me to set other shortcuts of this form. (For instance, I'd like to type syscurand have this auto-complete to System.currentTimeMillis();.)

在 Eclipse 中编程 Java 时,我可以输入syso并按下 control+space 来自动完成它并获得System.out.println();. 我想知道 Eclipse 中是否有设置允许我设置这种形式的其他快捷方式。(例如,我想输入syscur并自动完成此操作System.currentTimeMillis();。)

回答by Kai

You can do this here: Window-> Preferences-> Java-> Editor-> Templates. You can also add a Template View, which you find at Window-> Show View-> Other-> Search for Templates.

您可以在此处执行此操作:Window-> Preferences-> Java-> Editor-> Templates。您还可以添加模板视图,您可以在Window-> Show View-> Other-> 搜索模板中找到该视图。

回答by Christophe Roussy

This feature is called Code Templates

此功能称为代码模板