20

In Vim I can CTRL+W+H to switch to the split screen, how could one achieve the same in IntelliJ?

Example:

I press :vsplit it opens up a split-screen, now I'd like to switch between those screens.

I found this changelog but the option I'm looking for is not yet implemented.

Someone with another solution for this?

update:

I bruteforced some key combinations and it does change the screen when I press: CTRL+W+L CTRL+W+L

Arsen Khachaturyan
  • 7,904
  • 4
  • 42
  • 42
AME
  • 2,262
  • 6
  • 19
  • 39

3 Answers3

35

You can use Ctrl-W + h/j/k/l to navigate splits as in the original Vim. Ctrl-Wh should work. If it doesn't for you, check File | Settings | Vim Emulation and your ~/.ideavimrc config for some keyboard shortcut clashes.

There is one known issue when one split has a row of open tabs that is higher than the row of another split, then you cannot switch to it due to the miscalculation in the window coordinates.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Andrey Vlasovskikh
  • 16,489
  • 7
  • 44
  • 62
  • Additionally the control key bindings mentioned at http://vim.wikia.com/wiki/Switch_between_Vim_window_splits_easily also work, so you can define things like `map h` for faster switching. – Grzegorz Adam Hankiewicz Jun 09 '16 at 10:20
  • 1
    Warning: You need to use lower case h: `map h` works, but `map H` or `map ` do _not_. – Hope Mar 12 '19 at 14:47
  • For some reason I can get h/j/k to work but not l (ie L) for moving to the right. – user1978019 Nov 18 '21 at 19:27
  • Update: I found a long-forgotten `` remap hiding in the depths of my vimrc. Apparently the plugin I'd been using for vim/tmux navigation had already overridden it. – user1978019 Nov 18 '21 at 19:49
  • AHA! it was the double row of tabs thing that was throwing me off. Ctrl-w/l would work, but then Ctrl-w/h wouldn't. However, if I close the second row of tabes in the left window, it's fixed. That's annoying. – zostay May 18 '22 at 19:33
26

Ctrl + ww is a quick way to switch between windows. (Works for me on linux/intelliJ)

Mz A
  • 889
  • 11
  • 10
4

So far only way I could get this to work was to add this to my .ideavimrc:

    sethandler <c-h> a:vim
    sethandler <c-l> a:vim
    sethandler <c-j> a:vim
    sethandler <c-k> a:vim
    nnoremap <c-h> <c-w>h
    nnoremap <c-l> <c-w>l
    nnoremap <c-j> <c-w>j
    nnoremap <c-k> <c-w>k

This is for IdeaVim version 1.11.1 on Windows 10

Cory Koch
  • 470
  • 4
  • 8