Reputation: 128807
In Eclipse on Windows can I press myObject.
ctrl+space to 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+space and alt+space but nothing seems to work.
What is the keyboard shortcut for method suggestions in Eclipse on Mac OS X?
Upvotes: 54
Views: 102451
Reputation: 145
If your keyboard is like mine:
Then you have to press fn
+ control
+ space
(because you are really entering ^
+ space
)
Upvotes: 4
Reputation: 605
There is a specific set of proposals that were not enabled by default in my Eclipse installation on MacOS
Eclipse >> Preferences >> Java >> Editor >> Content Assist >> Advanced
Upvotes: 0
Reputation: 31666
For OSX Mavericks/Yosemite and later/earlier versions.
By default, Ctrl+Space is mapped to Spotlight, therefore if you want to use this shortcut in Eclipse you'll need to unmap it:
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. Keep in mind, you can always bring up the Spotlight search field by clicking it's icon (🔍 ) in the MacOS menu bar.
Now Ctr+Space should work in Eclipse as expected.
Upvotes: 24
Reputation: 7203
For OSX Big Sur and possibly later/earlier versions:
NOTE: obviously, you can just remap the Select the previous input source hot key to something else, in case you want to have a shortcut for it, e.g. You can remap it to Alt+F2.
Now Ctr+Space should work in Eclipse as expected.
Upvotes: 3
Reputation: 3275
Mac Os version: 11.01 Big sur
In your Eclipse or STS open preferences. Mac shortcut: cmd + < key
Upvotes: 1
Reputation: 19076
In my macOS High Sierra (ver.10.13.6) default control + space
combination seems to work for Eclipse, no change is necessary:
Upvotes: 0
Reputation: 447
There's 2 ways you can resolve this problem.
1.Stopping default Mac OS 'Spotlight' approach:
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
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)
Upvotes: 0
Reputation: 1
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.
Upvotes: -1
Reputation: 4163
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).
Upvotes: 8
Reputation: 1665
In Lion, CTRL+SPACE
is mapped to "Select Previous Input Source" in the "Language & Text, tab Input Sources" pref pane.
You can release this mapping by (here's the tricky part):
^SPACE
from the "Select Previous Input Source" function.^SPACE
now starts emitting a system event and you can map it in applications.
Upvotes: 2
Reputation: 205
you can find Word Completion under edit.(ie.Edit> Word Completion) And hence its ctr+.
Upvotes: 1
Reputation: 923
I think it is Command + 1 , but i haven't worked with eclipse for a while...
Upvotes: 4
Reputation: 78105
Think its 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)'.
Upvotes: 4
Reputation: 2129
By default I believe it's ctrl+space. You can check by going to Preferences > General > Keys and filtering for 'content assist'.
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.
Upvotes: 62