Escape to IntelliJ IDEA shortcuts from IdeaVim

Thirteenth Seeker picture Thirteenth Seeker · Aug 12, 2015 · Viewed 11.7k times · Source

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?

Answer

melihovv picture melihovv · Nov 29, 2015

I made .ideavimrc that contains bindings for all conflicted mappings. Maybe it'll be usefull to someone.

imap jj <Esc>

let mapleader = " "
map <leader>a :action $SelectAll<CR>
map <leader>b :action GotoDeclaration<CR>
map <leader>c :action $Copy<CR>
map <leader>d :action EditorDuplicate<CR>
map <leader>e :action RecentFiles<CR>
map <leader>f :action Find<CR>
map <leader>g :action GotoLine<CR>
map <leader>h :action TypeHierarchy<CR>
map <leader>i :action ImplementMethods<CR>
map <leader>m :action EditorScrollToCenter<CR>
map <leader>n :action FileChooser.NewFolder<CR>
map <leader>o :action OverrideMethods<CR>
map <leader>p :action ParameterInfo<CR>
map <leader>q :action QuickJavaDoc<CR>
map <leader>r :action Replace<CR>
map <leader>s :action SaveAll<CR>
map <leader>t :action Vcs.UpdateProject<CR>
map <leader>u :action GotoSuperMethod<CR>
map <leader>v :action $Paste<CR>
map <leader>w :action EditorSelectWord<CR>
map <leader>x :action $Cut<CR>
map <leader>y :action EditorDeleteLine<CR>
map <leader>[ :action EditorCodeBlockStart<CR>
map <leader>] :action EditorCodeBlockEnd<CR>