47
votes

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?

13
For any googlers that landed on this page whilst searching for xcode's equivalent: press the Esc key. - terphi
use [CMD + Shift + L] to watch all list. [ CNTRL + . ] - is Auto complete - Musa

13 Answers

58
votes

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.

18
votes

For OSX Mavericks/Yosemite and possibly later/earlier versions:

  1. Go to System Preferences -> Keyboard.
  2. Click the Shortcuts tab.
  3. Select Spotlight in the left pane (see screenshot below).
  4. Untick Show Spotlight Search field next to the shortcut combination ^Space as shown in the screenshot below.

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.

Now Ctr+Space will work in Eclipse

Now Ctr+Space should work in Eclipse as expected.

6
votes

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.enter image description here 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).

4
votes

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)'.

2
votes

I think it is Command + 1 , but i haven't worked with eclipse for a while...

2
votes

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):

  1. temporarily enabling an extra language
  2. going to "Keyboard Shortcuts" pref pane, "Keyboard & Text Input" group, and modifying/removing the ^SPACE from the "Select Previous Input Source" function.
  3. you can now remove the temporary language input that you added in step 1.

^SPACE now starts emitting a system event and you can map it in applications.

1
votes

you can find Word Completion under edit.(ie.Edit> Word Completion) And hence its ctr+.

1
votes

For OSX Big Sur and possibly later/earlier versions:

  1. Go to System PreferencesKeyboard.
  2. Click the Shortcuts tab.
  3. Select Input Sources in the left pane (see screenshot below).
  4. Untick Select the previous input source next to the shortcut combination ^Space as shown in the screenshot below.

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 will work in Eclipse

Now Ctr+Space should work in Eclipse as expected.

1
votes

Try the keys control + command + period (.)

0
votes

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)
0
votes

In my macOS High Sierra (ver.10.13.6) default control + space combination seems to work for Eclipse, no change is necessary:

enter image description here

enter image description here

0
votes

Mac Os version: 11.01 Big sur

In your Eclipse or STS open preferences. Mac shortcut: cmd + < key

enter image description here

  • General -> preferences -> keys -> scheme == Emacs
  • General -> preferences -> keys -> content Assist -> Binding == tab (see below in image for Binding dropdown, you can change here to tab)
  • now go to eclipse and use tab instead of cmd+space, you will the same result of cmd+space in windows by using tab in mac
-1
votes

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.