37

I can't find either the term autocomplete or intellisense in Preferences->General->Keys in Eclipse 3.6.2.

I don't want to press enter to select an autocomplete item when I write code. Can I configure Eclipse to accept an autocomplete item with the tab button?

Carl R
  • 8,104
  • 5
  • 48
  • 80
  • 3
    CTRL+SPACE usually does that. Search where this shortcut is used in the Preferences. – karlphillip Aug 04 '11 at 02:30
  • I had the same problem, especially when using php in eclipse. After typing ", eclipse will automatically makes it "". After typing some information inside "", I want to jump to the right side of " by using Tab - not right arrow button. This has been done well in Java, but not PHP (PDT plugin) in eclipse :( –  Aug 04 '11 at 02:32
  • Try filtering with "assist" as this feature is called "Content Assist" in Eclipse. – nicolaskruchten Aug 04 '11 at 02:40
  • And the short answer is that I don't think there is a configurable setting for that unfortunately, at least not one that I could find under OSX/Helios. – nicolaskruchten Aug 04 '11 at 02:41
  • @tsubasa I believe that in that case you can just type `"` again and it will move your cursor to the right of the pre-existing closing `"`. – nicolaskruchten Aug 04 '11 at 02:42
  • @nicolas, now the situation is something like this: define("Hello","Hello World!"); do I have to type " then ) in the Hello World ? I wish I just need to press Tab button... –  Aug 04 '11 at 23:44
  • @karlphillip - 'Ctrl + Space' does it by default, but is horrendously inconvenient compared to just using the tab key. You can use the preferences section to remap content-assist to the tab key, but then you lose the ability to have tabs in your code. This is a serious and long-standing shortcoming in Eclipse, in my opinion. – aroth Sep 19 '12 at 04:35
  • CTRL + SPACE is not the default key combination for this -- CTRL + SPACE *OPENS* the menu, it does not commit the auto complete. Reassigning "Content Assist" to another key combination, you'll see that this is the case. – BrainSlugs83 Oct 18 '14 at 23:21
  • 1
    It seems you can do this by reassigning the keys for "ALT+/" to TAB (this is Word completion) -- but you can't do it from the editor -- you have to export your preferences edit the text file and then reimport. -- Doing this works great, but it disables the ability to use TAB for other purposes (like tabbing!!), so it's probably not what you want. :-( – BrainSlugs83 Oct 18 '14 at 23:43

5 Answers5

13

I believe you are looking for "word completion" Left Alt + / though you can change it in "Preferences->General->Keys" to be whatever key combo. Pressing / multiple times cycles through the different suggestions. It's not very intelligent. For example if you have String apple; and double apps; and you type double x = a and then Alt + / eclipse might suggest apple instead of apps, even though apple is an String.

Edit: Looks like it's ctrl + / on some computers.

Ben
  • 2,430
  • 3
  • 22
  • 24
9

Just got it, go to Window>Preferences>General->Keys and look for "Word completion" as said before. Then near the bottom is "Binding" and to the right of it, a box with an arrow, clicking there you can select "Tab" to use Tabulator for autocomplete.

AM__ZB
  • 106
  • 1
  • 1
  • 2
    Beware, if you set the Tab key to "Word Completion", it might be possible that you lose the ability to insert tab characters when typing your source codes. – tom_mai78101 Mar 10 '20 at 02:03
  • 1
    @tom_mai78101 This is stupid... All other IDE's and programming text editors I have used use tab to insert the selected item in the auto-completion list. If someone prefers Enter for that, that is fine, but there should have been some easy setting to change it to tab without this kind of pitfall. – Damn Vegetables Jan 20 '22 at 17:46
  • shift+Tab is little better. – yu yang Jian Apr 03 '23 at 06:58
2

The autocompletion selection key(s) is editor specific. For instance in Aptana Studio, you could define set of keys for proposal selection. See e.g. Preferences/Aptana Studio/Editors/JavaScript. PyDev shares some code with Aptana Studio, so it has similar capabilities. See "Preferences/PyDev/Editor/Code Completion/Apply completion on *" checkboxes.

Speaking of the Tab key as a selector, it doesn't seem possible w/o extra coding since it has special meaning to focus into proposals window. For these who interested could find Tab handling at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(VerifyEvent)

Cheers, Max

Max
  • 2,917
  • 1
  • 16
  • 16
0

You can use this trick as mentioned -> https://stackoverflow.com/a/6508181/474002

After you jump to the item you want, press Tab -> Space

It's done. Hope this will help :)

Community
  • 1
  • 1
Browny Lin
  • 2,427
  • 3
  • 28
  • 32
0

I believe the same question is asked here Change hotkey for autocomplete selection

All key bindings in Eclipse are defined in Window -> Preferences -> General -> Keys. I don't think you can change what is used to select stuff from the autocomplete list, but you can use space to select and then Enter for new line.

Community
  • 1
  • 1
Ali
  • 12,354
  • 9
  • 54
  • 83