nocnoc
nocnoc

Reputation: 361

How to map custom ideavim keybinds to only normal mode?

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:

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

Upvotes: 1

Views: 654

Answers (1)

LJ replica
LJ replica

Reputation: 736

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.

Upvotes: 2

Related Questions