'Navigating between splits

I wanted to settup vim-tmux-navigation like navigation on intellij IDE and only way to settup this is from IdeaVim so my configuration in settings -> keymap looks like this:

  • VimWindowDown_____ alt J
  • VimWindowLeft______ alt L
  • VimWindowRight_____alt H
  • VimWindowUp_______ alt K

But when I split the windows it's not working.... Is this a bug or I'm missing some stuff?

Oh and don't suggest me switcher for my problem...



Solution 1:[1]

The best place for setting up custom keys for Vim actions is the ~/.ideavimrc file. You can use the standard Vim map/nmap/noremap/imap/... commands there. For example:

nmap <A-J> <C-W>j

For potential keymap conflicts between the Vim emulation and the IDE see Settings | Vim Emulation.

Chaning Vim actions via Settings | Keymap is not recommended.

Solution 2:[2]

OK, got a partial answer.

There is a "Go To Next Splitter" and "Go To Previous Splitter" commands in IntelliJ. So in the keymap settings, change or add keystrokes for those commands to C-h and C-l (or whatever you want). If you are using ideavim, don't forget to override those keymap settings so that C-h and C-l are set to use the IDE. C-h and C-l will probably already be used so be sure you don't need the existing hotkey before you make the change.

This solution will at least allow you to move left/right quickly. Not sure it's going to be possible to move between up/down splits without doing some scripting or if that's even possible to do with scripting.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andrey Vlasovskikh
Solution 2 StevieD