Eclipse - 默认键盘快捷键列表

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

Eclipse - List of default keyboard shortcuts

eclipsekeyboard-shortcuts

提问by James Cadd

Is there a list of the default Eclipse keyboard shortcuts? I'm generally looking for language agnostic things like starting the debugger or deleting an entire line in the source editor.

是否有默认的 Eclipse 键盘快捷键列表?我通常在寻找与语言无关的东西,比如启动调试器或在源代码编辑器中删除整行。

回答by VonC

Rather than a fulllist of shortcut (JGlassmentions for Eclipse 4.6 this pdf), I prefer using only a few shortcuts:

而不是一个完整的快捷方式列表(JGlass提到了 Eclipse 4.6这个 pdf),我更喜欢只使用几个快捷方式:

  • CTRL+Shift+L: "Show Key Assist", List of shortcuts (depending on the context)
  • CTRL+ Shift+ L:“显示按键辅助”,快捷键列表(取决于上下文)

http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.user/tips/images/key-assist.png

http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.user/tips/images/key-assist.png

  • CTRL+3: Quick Access
  • CTRL+ 3: 快速访问

http://4.bp.blogspot.com/-QqHaeh1yJDU/Tsoc0bZmaSI/AAAAAAAABVg/WzNyqfmRmXE/s1600/Eclipse+Quick+Access+now+shows+keybindings+for+commands.png
Source: "Good features of Eclipse 3.6 (Eclipse Helios) JDT, 2011, from Sony Thomas"

http://4.bp.blogspot.com/-QqHaeh1yJDU/Tsoc0bZmaSI/AAAAAAAABVg/WzNyqfmRmXE/s1600/Eclipse+Quick+Access+now+shows+keybindings+for+commands.png
资料来源:“ Eclipse 3.6 (Eclipse Helios) JDT 的良好特性,2011,来自 Sony Thomas

Those two covers almost everything.

这两个几乎涵盖了所有内容。

You can add two others:

您可以添加另外两个:

  • CTRL+1: Quick Fix
  • CTRL+ 1: 快速修复

http://depth-first.s3.amazonaws.com/20080111/list_options.png

http://depth-first.s3.amazonaws.com/20080111/list_options.png

http://www.willianmitsuda.com/wp-content/uploads/eclipse_tips/spy_opentype.gif

http://www.willianmitsuda.com/wp-content/uploads/eclipse_tips/spy_opentype.gif



Note that Eclipse 2019-09now shows key bindings when command is invoked.

请注意,Eclipse 2019-09现在会在调用命令时显示键绑定。

For presentations, screen casts and learning purposes, it is very helpful to show the corresponding key binding when a command is invoked.
When the command is invoked (via a key binding or menu interaction) the key binding, the command's name and description are shown on the screen. Key binding of triggered command shown on screen

对于演示、屏幕投射和学习目的,在调用命令时显示相应的键绑定非常有帮助。
当调用命令(通过键绑定或菜单交互)时,键绑定、命令的名称和描述会显示在屏幕上。屏幕上显示的触发命令的键绑定

https://www.eclipse.org/eclipse/news/4.13/images/show_key_bindings.png

https://www.eclipse.org/eclipse/news/4.13/images/show_key_bindings.png

You can activate this in the Preferences dialog via the Show key binding when command is invoked check box on the General > Keyspreference page.
To toggle this setting quickly the command 'Toggle Whether to Show Key Binding' can be used (e.g. via the quick access).

您可以通过General > Keys首选项页面上的调用命令时显示键绑定复选框在首选项对话框中激活此功能。
要快速切换此设置,Toggle Whether to Show Key Binding可以使用命令“ ”(例如,通过快速访问)。

回答by Koray Güclü

As VonC said you can get alist of short cuts with the following command.

正如 VonC 所说,您可以使用以下命令获取捷径列表。

Ctrl+ Shift+ L"Show Key Assist", List of shortcuts (depending on the context)

Ctrl+ Shift+ L“显示按键辅助”,快捷键列表(取决于上下文)

SHORTCUTS FOR DEVELOPMENT

发展的捷径

But here are some which you will use often during your development.

但是这里有一些您在开发过程中会经常使用的。

Ctrl+ Shift+ PSwitch between openning and closing braces.

Ctrl+ Shift+P在左括号和右括号之间切换。

Ctrl+ Shift+ ROpen any file quickly without browsing for it in the Package Explorer. This shortcut opens a dialog box that accepts the name of the file you're looking for.

Ctrl+ Shift+R无需在包资源管理器中浏览即可快速打开任何文件。此快捷方式将打开一个对话框,该对话框接受您要查找的文件的名称。

Ctrl+ Shift+ TOpen a type (e.g.: a class, an interface) without clicking through interminable list of packages. If what you want is a Java type, this shortcut will do the trick.

Ctrl+ Shift+T打开一个类型(例如:一个类,一个接口),而不用点击无休止的包列表。如果您想要的是 Java 类型,则此快捷方式可以解决问题。

Ctrl+ OGo directly to a member (method, variable) of a class file, especially when there are a lot of methods.

Ctrl+O直接跳转到类文件的一个成员(方法,变量),尤其是方法很多的时候。

Ctrl+ Shift+ FFormat code.

Ctrl+ Shift+F格式代码。

Ctrl+ Shift+ /Comment out XML or JSP code.

Ctrl+ Shift+/注释掉 XML 或 JSP 代码。

Ctrl+ LGo to line number N in the source file.

Ctrl+L转到源文件中的第 N 行。

Ctrl+ EShow a list of open editors.

Ctrl+E显示打开的编辑器列表。

Ctrl+ F6Move between open editors.

Ctrl+F6在打开的编辑器之间移动。

Ctrl+ 1Quick Fix.

Ctrl+1快速修复。

Ctrl+ 3Quick Access.

Ctrl+3快速访问。

Ctrl+ QGo to the last edit location.

Ctrl+Q转到最后一个编辑位置。

Ctrl+ TGo to a supertype/subtype.

Ctrl+T转到超类型/子类型。

Ctrl+ IIndent selected code block.

Ctrl+I缩进选定的代码块。

Ctrl+ +Move to one problem (i.e.: error, warning) to the next (or previous) in a file.

Ctrl++将一个问题(即:错误、警告)移至文件中的下一个(或上一个)问题。

F3Go to a type declaration.Alternatively, you can hold Ctrl down and click (ie: Ctrl+ Click) the hyperlinked variable.

F3转到类型声明。或者,您可以按住 Ctrl 并单击(即:Ctrl+ Click)超链接变量。

SHORTCUTS FOR VARIABLE GENERATION

变量生成的捷径

Ctrl+ 2+ LGenerate return value type and variable assignment

Ctrl+ 2+L生成返回值类型和变量赋值

Alt+ Shift+ LGenerate return value type and variable assignment. but here you can make selections.

Alt+ Shift+L生成返回值类型和变量赋值。但在这里您可以进行选择。

SHORTCUTS FOR DEBUGGING

调试快捷方式

F8Resume

F8恢复

CTRL+ F8Resume.

CTRL+F8恢复。

F5Step Into

F5踏入

F6Step Over

F6跨过

F7Step Return

F7步进返回

CTRLRRun to Line.

CTRLR跑到线。

F11RDebug

F11R调试

CTRL+ SHIFT+ BToogle Break Point

CTRL+ SHIFT+B工具断点

You can find further shortcuts under : Help → Help Contents → Java Development User Guide → Reference → Menus and Actions

您可以在以下位置找到更多快捷方式:帮助 → 帮助目录 → Java 开发用户指南 → 参考 → 菜单和操作

回答by JGlass

The fulllist of defaults in Eclipse 4.6 and earlier versions can be obtained from this GIT Hub page: https://github.com/pellaton/eclipse-cheatsheetspecifically https://github.com/pellaton/eclipse-cheatsheet/raw/master/eclipse4.6/eclipse-shortcuts-4.6.0.pdf

Eclipse 4.6 和更早版本的完整默认值列表可以从这个 GIT Hub 页面获得:https: //github.com/pellaton/eclipse-cheatsheet特别是https://github.com/pellaton/eclipse-cheatsheet/raw/ master/eclipse4.6/eclipse-shortcuts-4.6.0.pdf

回答by maximdim

Previous answer not quite correct as in Eclipse you can redefine keyword shortcuts (as I often do).

以前的答案不太正确,因为在 Eclipse 中您可以重新定义关键字快捷方式(我经常这样做)。

You can always access current list of defined shortcuts by pressing Ctrl+ Shift+ Lin Eclipse (on Windows at least).

你总是可以通过按访问定义快捷键的当前列表Ctrl+ Shift+ L(至少在Windows上)在Eclipse。