Mac OS X 上 Eclipse 中方法建议的键盘快捷键是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4764623/
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
What is the keyboard shortcut for method suggestions in Eclipse on Mac OS X?
提问by Jonas
In Eclipse on Windows can I press myObject.
ctrl+spaceto get a list of all methods for the object. But on Mac OS X this doesn't seem to work. I have tried ctrl+space, cmd+spaceand alt+spacebut nothing seems to work.
在 Windows 上的 Eclipse 中,我可以按myObject.
ctrl+space来获取对象的所有方法的列表。但是在 Mac OS X 上这似乎不起作用。我试过ctrl+ space、cmd+space和alt+space但似乎没有任何效果。
What is the keyboard shortcut for method suggestions in Eclipse on Mac OS X?
Mac OS X 上 Eclipse 中方法建议的键盘快捷键是什么?
回答by William Scott
By default I believe it's ctrl+space. You can check by going to Preferences > General > Keys and filtering for 'content assist'.
默认情况下,我相信它是ctrl+ space。您可以通过转到“首选项”>“常规”>“键”并过滤“内容辅助”来进行检查。
If it's not working, you may have a binding from OS X or another application overriding it. If a window with a blank list is popping up, you may need to adjust which suggestions are shown by default in Preferences > Java > Editor > Content Assist > Advanced. You can continue pressing the binding to cycle through the different types of suggestions.
如果它不起作用,您可能有来自 OS X 的绑定或覆盖它的其他应用程序。如果弹出一个带有空白列表的窗口,您可能需要在 Preferences > Java > Editor > Content Assist > Advanced 中调整默认显示的建议。您可以继续按绑定循环浏览不同类型的建议。
回答by ccpizza
For OSX Mavericks/Yosemite and possibly later/earlier versions:
对于 OSX Mavericks/Yosemite 以及可能更高/更早的版本:
- Go to System Preferences-> Keyboard.
- Click the Shortcutstab.
- Select Spotlightin the left pane (see screenshot below).
- Untick Show Spotlight Search fieldnext to the shortcut combination ^Spaceas shown in the screenshot below.
- 转到System Preferences-> Keyboard。
- 单击Shortcuts选项卡。
- 在左窗格中选择Spotlight(见下面的屏幕截图)。
- 取消选中快捷方式组合旁边的“显示 Spotlight 搜索”字段^Space,如下面的屏幕截图所示。
NOTE: obviously, you can just remap the Spotlight hot key to something else, in case you want to have a shortcut for it, e.g. I remapped it to Alt+F2.
注意:显然,您可以将 Spotlight 热键重新映射到其他东西,以防您想为其设置快捷方式,例如我将其重新映射到Alt+ F2。
Now Ctr+Spaceshould work in Eclipse as expected.
现在Ctr+Space应该按预期在 Eclipse 中工作。
回答by Janmenjaya
Finally! I found how to get the keyboard shortcut for code completion working in Eclipse on Mac OS X. At work, on Linux, I use CTRL-SPACE all the time in Eclipse. Unfortunately that did not work on my MacBook: CMD-SPACE triggers the spotlight search widget and CTRL-SPACE is tied to the Quicksilver launcher in my case.And there was much frustration.
First: don't say "code completion", but "content assist" in Eclipse. To bring even more confusion, there is also the "word completion" tool in the edit menu, but that's not what you normally want (it's just limited to completing a variable name without much context sensitivity). "Content assist" offers you the usual suggestions you expect from a completion tool (function names, variables, methods, properties, modules, ...).
Once I got this, it I just had to edit the keyboard shortcut for "content assist" to something that was still available (I chose ALT-SPACE).
最后!我找到了如何在 Mac OS X 上的 Eclipse 中获取用于代码完成的键盘快捷键。在工作中,在 Linux 上,我一直在 Eclipse 中使用 CTRL-SPACE。不幸的是,这在我的 MacBook 上不起作用:在我的情况下,CMD-SPACE 触发了聚光灯搜索小部件,而 CTRL-SPACE 与 Quicksilver 启动器相关联。并且有很多挫败感。第一:在 Eclipse 中不要说“代码完成”,而要说“内容辅助”。更令人困惑的是,编辑菜单中还有“单词完成”工具,但这不是您通常想要的(它只是仅限于完成一个没有太多上下文敏感性的变量名称)。“内容辅助”为您提供了您期望从完成工具中获得的常用建议(函数名称、变量、方法、属性、模块等)。一旦我得到这个,我只需要将“内容辅助”的键盘快捷键编辑为仍然可用的东西(我选择了ALT-SPACE)。
回答by martin clayton
Think its shift+ctrl+space.
认为其 shift+ ctrl+ space。
In my installation the equivalent to the auto suggest is unbound, but you can attach a binding in Preferences>General>Keys. The Command is called 'Content Assist (type: Java Proposals)'.
在我的安装中,自动建议的等效项未绑定,但您可以在首选项>常规>键中附加绑定。该命令称为“内容辅助(类型:Java 建议)”。
回答by woodleader
I think it is Command+ 1, but i haven't worked with eclipse for a while...
我认为它是Command+ 1,但我有一段时间没有使用 eclipse 了......
回答by Kirthika Vijayakumar
you can find Word Completion under edit.(ie.Edit> Word Completion) And hence its ctr+.
您可以在编辑下找到 Word Completion。(即编辑> Word Completion)因此它的 ctr+。
回答by youurayy
In Lion, CTRL+SPACE
is mapped to "Select Previous Input Source" in the "Language & Text, tab Input Sources" pref pane.
在 Lion 中,CTRL+SPACE
映射到“语言和文本,选项卡输入源”首选项窗格中的“选择上一个输入源”。
You can release this mapping by (here's the tricky part):
您可以通过以下方式发布此映射(这是棘手的部分):
- temporarily enabling an extra language
- going to "Keyboard Shortcuts" pref pane, "Keyboard & Text Input" group, and modifying/removing the
^SPACE
from the "Select Previous Input Source" function. - you can now remove the temporary language input that you added in step 1.
- 暂时启用额外的语言
- 转到“键盘快捷方式”首选项窗格,“键盘和文本输入”组,并
^SPACE
从“选择上一个输入源”功能中修改/删除。 - 您现在可以删除您在步骤 1 中添加的临时语言输入。
^SPACE
now starts emitting a system event and you can map it in applications.
^SPACE
现在开始发出系统事件,您可以将其映射到应用程序中。
回答by Satya
There's 2 ways you can resolve this problem.
有两种方法可以解决此问题。
1.Stopping default Mac OS 'Spotlight' approach:
1.停止默认的 Mac OS 'Spotlight' 方法:
Go to System Preferences -> Keyboard.
Click the Shortcuts tab.
Select Spotlight in the left pane (see screenshot below).
UnSelect Show Spotlight Search field next to the shortcut
combination ^Space as shown in the screenshot below or Change it to
your preferred shortcut.
2.Modifying the Eclipse 'Content Assist' (actual name for code/method suggestion feature)shortcut keys
2.修改Eclipse'Content Assist' (代码/方法建议功能的实际名称)快捷键
You can change shortcut key in Eclipse by going to
Preferences > General > Keys and filtering for 'content assist'.
Change/Update the Shortcut key to your preferred one. (I preferred Alt+Space)
回答by Simeon Leyzerzon
回答by Akatzuki
In Windows 7, I was able to solve my problem by viewing all the global keyboard shortcuts that are bound from Windows Hotkey Explorer which showed me that I was using CTRL+Space as a key bind to mute my microphone on skype. Apparently, after rebinding that shortcut, Code assist started functioning properly.
在 Windows 7 中,我能够通过查看从 Windows 热键资源管理器绑定的所有全局键盘快捷键来解决我的问题,这表明我正在使用 CTRL+Space 作为键绑定来使 Skype 上的麦克风静音。显然,在重新绑定该快捷方式后,代码助手开始正常运行。