ideavim how to navigate to declaration / implementation of a method?

12,390

Solution 1

I've noticed that 'gd' seems to go to the declaration.

Solution 2

With ideavim default settings, press 'gd' in Normal mode can jump to the declaration, but no way to go to the implemetation by default.

So you can modify it by yourself, touch new file ~/.ideavimrc, and then set your own keymapper in that file:

nmap g] :action GotoImplementation<CR>

'GotoImplementation' is an action defined by IntelliJ,so press 'g]' will run this action. Try it.

Solution 3

In my case, I want Ctrl-B to do the default "Go To Declaration", but it wouldn't do anything because Vim emulation was intercepting the key combo.

The fix for me was

Preferences
> Editor
> Vim Emulation
> "Ctrl-B, Declaration"
> Change from "Vim" to "IDE"
Share:
12,390
Jas
Author by

Jas

Updated on June 05, 2022

Comments