I'm really impressed with the autocomplete feature of the IntelliJ IDE so far.
What I'd like to do, is cycle through the autocomplete suggestions I get when hitting Ctrl + Space without using the arrow keys (↑, ↓).
The reason for this is that I prefer to keep my fingers on the home row (I'm using IntelliJ's Vim emulator additionally).
For example, how would I select sortThis
instead of sorted
without using the arrow keys or the mouse?
Peter Gromov's answer brought me to a satisfying solution:
In IntelliJ's settings, for Keymap → Editor Actions → Down
I set a custom shortcut: Ctrl + J.
This way I can cycle forward through the suggestions.
Setting a shortcut for Down with Selection
or Scroll Line Down
in the IdeaVim-specific shortcuts did not affect the selection of autocomplete suggestions though.
For macOS the IDE will give a hint that "^↑
and ^↓
will move caret up and down in the editor". These clearly do not work.
There are a few extra steps that are needed after following @matthias-braun's solution.
Here is the full list of step that I use:
Preferences -> Keymap
Editor Actions
(not Plug-ins -> IdeaVim
)Down
Add Keyboard Shortcut
^N
)*Up
(I use ^P
)Ok
**Preferences -> Other Settings -> Vim Emulation
Handler
column for the row containing Down
, select Vim
***Up
* If you are warned about the key binding already existing then remove it. You can always reset back to the defaults by clicking the little cog icon up the very top to the right of the drop-down menu.
** The Vim Emulation
doesn't seem to be populated correctly until you reopen the Preferences
.
*** I'm not sure why the Handler
should be Vim
. This seems backwards to me but it works.
The answer here: https://stackoverflow.com/a/9713306/2370679 led me to discover that Ctrl+n
& Ctrl+p
allow navigation of the auto-complete options without having to modify any settings
If you're able to scroll up/down in editor with some IdeaVIM-specific shortcuts, they should also work in the completion list.
In this particular case, I'd just type another "t" so that "sortThis" becomes selected (and the only) variant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With