Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open class file in IdeaVim through shortcut?

I'm using IntelliJ IDEA with IdeaVim. Usually I can open any class file by shortcut Ctrl+N without IdeaVim, which is really handy. However when I switched to IdeaVim, The shortcut doesn't work both in Normal Mode and Insert Mode. Neither can I find a settings option in the following dialog. enter image description here

I'd really appreciate that if anyone can shed light on this issue. :)

like image 712
kenshinji Avatar asked Dec 10 '22 12:12

kenshinji


2 Answers

  1. You can use :actionlist *class* to find an IDE action for going to the definition of a class.

  2. You can use the found action :action GotoClass as a Vim command-mode command.

  3. You can map this command to any key combination in any Vim mode you want using the :map family of Vim commands, e.g. :nmap ,c :action GotoClass<CR>.

  4. You can put your mapping command into ~/.ideavimrc so it'll load at startup:

~/.ideavimrc:

nmap ,c :action GotoClass<CR>
like image 71
Andrey Vlasovskikh Avatar answered Jan 29 '23 09:01

Andrey Vlasovskikh


Change handler(last column in this image) of this shourtcut to IDE.

like image 22
Rumid Avatar answered Jan 29 '23 09:01

Rumid