I'm used to both vim and IntelliJ default hotkeys. I'd like to not to have to change any of them - I'd rather like to be able to use conflicting IntelliJ bindings, like CTRL-P for example, after some kind of escape key.
Conflict balloon and my research wasn't too helpful. Only thing that I've found is that I can turn vim plugin off with a hotkey, and then back on after I'm done, but I have to remember to turn it one every time.
Is there any solution for my problem?
I just turn VIM plugin off, execute keystroke, then turn it back on. I have ^Z bound to the VIM Emulator command for this purpose and it's enough for me. To set this up, go to Preferences... => Keymap, search for "vim emulator", and right-click on the command name to assign a shortcut.
But if you have a limited set of IntelliJ commands you want to use with a prefix key, you could pick the prefix key, make sure it is unbound in IntelliJ, and then use it in your ~/.ideavimrc
along with the original binding you wan to invoke.
For example, ^D in VIM is "Scroll window Downwards" and in IntelliJ (with keymap "Mac OS X 10.5+") is "Debug". If you want to be able to use both:
In your ~/.ideavimrc
, add the following mapping:
nnoremap <C-Z><C-D> :action Debug<CR>
Now you can type ^D for the Vim action scroll down, or ^Z^D for the IntelliJ action Debug, without actually disabling IdeaVIM. You'll of course have to add a mapping to your ~/.ideavimrc for each IntelliJ command you want to execute this way, but if you have a limited number you can set them up once and be done with it.