10

Here are the ways the Eclipse documentation states you can navigate the Content Assist list:

You can use the mouse or the keyboard (Up Arrow, Down Arrow, Page Up, Page Down, Home, End, Enter) to navigate and select lines in the list.

But all of the options require you to move your hands significantly away from their natural place on the keyboard!

Are there any other, quicker ways I can navigate this list? Something like tab, or the j/k from vi?

ThePhi
  • 2,373
  • 3
  • 28
  • 38
volni
  • 5,196
  • 8
  • 38
  • 44

3 Answers3

14

This is a great feature, and you can implement it like so: bind movement keys in Eclipse's key binder and then use them in the content assist menu!

Preferences/General/Keys

Line Down: Bind to Ctrl+K Line up: Bind to Ctrl+I

(both when 'Editing Java Source')

and then try moving with Ctrl-K/I when the content assist pops up!

In Kepler, as jed mentions in the comments, select "when editing text" instead and it should work.

Mark Waschkowski
  • 395
  • 1
  • 4
  • 10
  • Wow,thank you this was a lifesaver! :-) I use vrapper to emulate vim and it's so convenient to use Ctrl+N, Ctrl+P, in selection lists but it wasn't possible before I found your hint. Thank you! – dimsuz Sep 29 '11 at 19:39
  • Sure thing buddy - it took me a while to figure it out, glad you like it! – Mark Waschkowski Oct 17 '11 at 18:23
  • 4
    Unfortunately I've found that with the latest version of the Juno release of eclipse this no longer works :( – Mark Waschkowski Aug 21 '12 at 17:29
  • It is _unbelievable_ but _indeed_ this has been broken in Juno! **AAARGH**!! `:(` – Robottinosino Mar 22 '13 at 08:03
  • I used this **a lot**. Have you found a solution in the meantime, @MarkWaschkowski? – Robottinosino Mar 22 '13 at 08:05
  • @qed - how does this work on Kepler? I have bound ctrl+p / ctrl+n to line up and line down respectively, and when the code assist pops up, ctrl+p/n still move the cursor rather than the code assist selection. – Asfand Qazi Feb 26 '14 at 09:09
  • I just did as in the answer, except I selected "when editing text" – qed Feb 26 '14 at 16:57
4

If you try to fill in the content manually, Eclipse will move.

The search is quite advanced, e.g. "ArL" can match ArrayList, etc., so if you know what you are looking for, instead of navigation you could use search.

Zoltán Ujhelyi
  • 13,788
  • 2
  • 32
  • 37
0

This is certainly not a solution for everyone, but if you switch to the Emacs keyboard layout you can just use the key bindings for the "previous line" and "next line" commands, e.g., Ctrl-P and Ctrl-N.

lex82
  • 11,173
  • 2
  • 44
  • 69