IdeaVim and Neovim shared keyboard shortcuts map

866 Views Asked by At

I'm using both:

  • Neovim with LSP, etc (using LazyVim config but open to change to another modern one)
  • IntelliJ with IdeaVim, mainly for Java/Kotlin with Spring, etc

Has anyone come up with a shared set of key mappings that would work across both? I don't mean using single configuration file, configuring both separately is fine. But I'd like not to have to learn two completely separate set of mappings when using both editors/IDEs.

1

There are 1 best solutions below

0
Halibut On

Regular VIM bindings will work in Ideavim as well, you can even source your VIM mappings file in your .ideavimrc to only write them once.

LSP features like diagnostics, code actions, goto definition, etc... do not exist in Ideavim because you are supposed to use the equivalent features from your Jetbrains IDE instead.

The trick is that you can setup an Ideavim mapping for almost any IDE action. For example, in my config, I have nmap gl <Action>(ShowErrorDescription) to map the key sequence g + l to the IDE equivalent of Neovim LSP diagnostics.

You can get a list of all the IDE action codes by using the :actionlist command for the whole list or :actionlist keyword to search for something specific.

You may also take a look at this Github discussion where people share their Ideavim config. That should give you a good idea of all the cool things you can do with it.