How to map custom ideavim keybinds to only normal mode?

351 Views Asked by At

In ideavim normal mode, I would like to switch between my tabs and splitters similarly to how it is in the firefox extension vimium. My current solution has been to use caps lock if I wanted to type those letters in capitol.

My intended behavior is:

  • Select next/previous tab:

    • Pycharm keybind: "Alt + right/left"
    • Intended ideavim normal mode keybind: "Shift + k/j"
  • Select next/previous splitter:

    • Pycharm keybind: "Alt + ./,"
    • Intended ideavim normal mode keybind: "Shift + l/h"

Currently this is my unsuccessful code for it in .ideavimrc. Any ideas on what might be going wrong?

nmap <S-j> <M-Left>
nmap <S-k> <M-Right>
nmap <M-.> <S-l>
nmap <M-,> <S-h>

let g:ideavim_custom_mappings = 1
1

There are 1 best solutions below

0
LJ replica On

It's not possible to bind a vim shortcut to the IntelliJ IDEA shortcut when using IdeaVIM and you need to bind action for it. , but you could try the below instead which works and better:

nmap <S-j> <action>(PreviousTab)
nmap <S-k> <action>(NextTab)
nmap <M-.> <action>(NextSplitter)
nmap <M-,> <action>(PrevSplitter)

You could see all the action list via :actionlist.