Using Vim motions to navigate Intention Actions menu in IntelliJ

Answered

Hi,

I’m using the IdeaVim plugin in IntelliJ and have mapped Leader+a to show Intention Actions:

nnoremap <Leader>a :action ShowIntentionActions<CR>

This successfully opens the menu, but I cannot use Vim motions (j/k) to navigate the list of intentions. Currently, I can only use the arrow keys.

Is there a way to enable Vim-style navigation (j/k) inside the Intention Actions popup, or to remap these motions specifically for this popup?

I’m looking for a solution that keeps the IdeaVim experience consistent across all popups.

Thanks in advance!

0
3 comments

Hi Dilipgona Dev 

Unfortunately, this is a known limitation of IdeaVim. The Intention Actions popup (and many other IDE popups/dialogs) don't support Vim motions like j/k for navigation by default. These popups are native IntelliJ UI components that operate independently of the IdeaVim plugin's keybindings.

There're some workarounds but these don't work consistently for enabling j/k navigation specifically in the Intention Actions popup while using IdeaVim. This is because:

  1. The popup is a native Swing/UI component that doesn't inherit IdeaVim keybindings
  2. IdeaVim's scope is limited to the editor area, not all UI dialogs
  3. The popup captures keyboard input before IdeaVim can intercept it

Also, this is a request feature in the IdeaVim community. If you'd like to see this improved, I'd recommend:

  • Checking the IdeaVim GitHub repository for existing issues
  • Creating or upvoting a feature request for better popup navigation support
0

Can i able to move the arrow up and down without using the arrow keys.

0

Hello Dilipgona Dev 

As a workaround to navigate popups without arrow keys, you can:

  1. Use IntelliJ's keyboard shortcuts in the Vim settings:
    1. Go to Settings | Editor | Vim
    2. Look for shortcuts like Ctrl+N (Down) and Ctrl+P (Up)
    3. Set them to "IDE" mode so they work in popups (IntelliJ IDEA will handle the keys)
  2. Add custom mappings in .ideavimrc:

       inoremap <C-j> <Down>
       inoremap <C-k> <Up>

You ca also check the YouTrack ticket IJPL-55292 and see if it helps.

However, there's no perfect solution for making j/k work in all IDE popups.

I hope this helps.

0

Please sign in to leave a comment.