Jonas
Jonas

Reputation: 128807

What is the keyboard shortcut for method suggestions in Eclipse on Mac OS X?

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

Answers (16)

Beto
Beto

Reputation: 145

If your keyboard is like mine: enter image description here Then you have to press fn + control + space (because you are really entering ^ + space)

Upvotes: 4

PedroPK
PedroPK

Reputation: 605

There is a specific set of proposals that were not enabled by default in my Eclipse installation on MacOS

enter image description here Eclipse >> Preferences >> Java >> Editor >> Content Assist >> Advanced

Upvotes: 0

B2i7la5l
B2i7la5l

Reputation: 1

you can use Fn + command + space or option + Esc

Upvotes: 0

ccpizza
ccpizza

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:

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

Now Ctr+Space should work in Eclipse as expected.

Upvotes: 24

odins
odins

Reputation: 161

Try the keys control + command + period (.)

Upvotes: 15

madx
madx

Reputation: 7203

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.

Upvotes: 3

Guru Cse
Guru Cse

Reputation: 3275

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

Upvotes: 1

Simeon Leyzerzon
Simeon Leyzerzon

Reputation: 19076

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

Upvotes: 0

Satya
Satya

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

Akatzuki
Akatzuki

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

Janmenjaya
Janmenjaya

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

Upvotes: 8

youurayy
youurayy

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

  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.

Upvotes: 2

Kirthika Vijayakumar
Kirthika Vijayakumar

Reputation: 205

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

Upvotes: 1

woodleader
woodleader

Reputation: 923

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

Upvotes: 4

martin clayton
martin clayton

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

William Scott
William Scott

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

Related Questions